Difference in Graphics objects?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Glenn

    Difference in Graphics objects?

    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?
  • Supra

    #2
    Re: Difference in Graphics objects?



    Glenn wrote:
    [color=blue]
    >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?
    >
    >[/color]

    Comment

    Working...