Loading ...
Sorry, an error occurred while loading the content.

Re: [cc2-dev-l] Tranparent images in a dialog box

Expand Messages
  • Mike Riddle
    Directly, No. You will need to build a DIB, transfer the transparency there, over the dialog background color, and BLT the result to a BUTTON control that
    Message 1 of 4 , Dec 17, 2004
    • 0 Attachment
      Directly, No. You will need to build a DIB, transfer the transparency
      there, over the dialog background color, and BLT the result to
      a BUTTON control that displays a bitmap. Or one could create a custom
      control to do essentially the same thing. You can't get
      a DIB section of the dialog bix DC, so there is no way to directly paint
      it on a Win32 dialog. Sorry.

      Mike

      jslayton@... wrote:

      > I don't know of a way to do this off the top of my head but that's a
      >good thing because the top of my head isn't an XP dialog.
      >
      > I believe that GDI+ has a way to draw alpha-blended images, but I'm not
      >sure about color-keyed images like GIFs.
      >
      > http://www.codeproject.com/bitmap/render.asp purports to load and render
      >images with transparency.
      >
      > http://www.codeproject.com/bitmap/cpicture.asp has an example of the
      >IPicture interface for drawing various types of bitmaps but I'm not sure
      >if it will directly render the transparency correctly.
      >
      > And then there's the worst case option - read your background into a
      >DIB, copy the non-transparent parts onto the DIB manually, and then blit
      >it back to the dialog.
      >
      > Joe Slayton
      >
      >
      >
      >>Is there any way to place an image that has transparent portions (such
      >>as a GIF) in a XP dialog box?
      >>
      >>
      >
      >
      >
      >
      >
      >To Post a message, send it to: cc2-dev-l@...
      >To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...
      >Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.