Discussion:
GDI+ textured rectangle - WrapModeClamp - nothing gets drawn
(too old to reply)
R.Wieser
2020-02-07 08:54:33 UTC
Permalink
Hello all,

I'm trying to draw, in GDI+, a textured rectangle. It works, and providing
GdipCreateTexture with WrapModes to flip the texture around also work.

The thing is that the "WrapModeClamp" argument causes nothing to be drawn,
though all the functions (load image, create texture brush, draw filled
rectangle) return success statuses.

Does anyone have an idea what goes on here ?

Regards,
Rudy Wieser
R.Wieser
2020-02-07 12:12:32 UTC
Permalink
Post by R.Wieser
The thing is that the "WrapModeClamp" argument causes nothing to be drawn,
It turns out that he "clamping" just means that the texture is only drawn
once (meaning: no repeats horizontally or vertically).

The problem with that is that the origin of the texture is always(?) at 0,0
, which means that its /very/ easy to have a texture fully outside (to the
above-left) of the drawn rectangle, circle or other, in effect making it
invisible. :-(

Regards,
Rudy Wieser

Loading...