Results 1 to 24 of 24

Thread: AlphaTransparent Image as form background

Threaded View

  1. #1

    Thread Starter
    Addicted Member vigge89's Avatar
    Join Date
    May 2002
    Location
    Sweden
    Posts
    172

    AlphaTransparent Image as form background

    My current project allows the user to skin the application. I'm using GDI+ for painting an image as the background for the program. The image is either an 32bit bitmap or an 24bit PNG. I want to paint the image directly on the screen (so alphatransparency is keeped, pixels which is semi-transparent in the image should be it on the screen). I'm currently painting the image on the form, which makes the image painted overlap the form, so it doesn't keep it's transparency. So you can say that i want to make the form-background invisible, while keeping the painted image and the controls on the form visible.

    this is how it should look like (taken from another app):

    The image isn't painted on the form, it's painted directly on the screen or whatever you should call it.

    this is the image which should be painted (24bit png with transparency):


    This is how it currently looks like:

    The reason why i got pink/purple background is becuase i'm using SetLayeredWindowAttributes() to make the color pink/purple go invisible. But since the image is painted on the form, the image's parts where it is semi-transparent is chaning the pink behind it to another color. I would like to scrap the "pink is invisible"-function and instead use images with transparency to decide the invisibility of the pixels.

    I have no idea on how to solve this. Are there anyone who is familiar with this? I've looked after a solution for one week, but i can't find anything regarding this.

    Thanks in advance.
    Last edited by vigge89; May 31st, 2004 at 02:04 PM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width