Difference in Graphics objects?

G

Guest

We use GDI code to do some drawing with R2_MASKPEN (because there doesn't
seem to be a GDI+ way of doing it). We're getting the HDC from a Graphics
object passed in to the method. This works fine if the Graphics was created
from a Form or Control, but when the Graphics object is created from an
Image, the result is black.

I tried using the Flush method before getting the HDC, but it only seems to
be a solid black image. I also tried getting an HBITMAP from the HDC, but
it's black as well.

The only difference I can see in these Graphics objects is the ClipBounds.
Does the Graphics object work differently if it's created from an Image? Any
idea how to work directly with the pixel data in a Graphics object?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top