Hi,
I decided to post my question on this site after seeing all the impressive work by LaVolte and the many discussions around it.
BACKGROUND
My application allows users to manipulate images on-screen by dragging and dropping them in different locations. To do that most efficiently, it loads initially all images (from files) in a collection (properties: ID, Filename, Picture) and references the collection every time the screen needs to be redrawn. The Picture property in the collection is a StdPicture which is filled with the LoadPicture method, so I limited the image-formats to jpg and emf (for transparency support). The images are drawn on a PictureBox using the PaintPicture method, allowing it to be drawn in a different size than the original.
WISH
I like the application to support png-files incl. transparency. So, I thought to be clever and do that by using GDI+ to load the png-file and then converting it to the StdPicture in the collection, so that I could leave the rest of the application untouched. Unfortunately I lose transparency in that process. :-(
QUESTION
Does anyone have a suggestion how I could achieve png with transparency support while keeping the current structure of my application? Maybe Im oversimplifying, but could it be something like defining the Picture property in the collection as a GDIPlusPicture and using a GDIPlusPaintPicture method to draw them?
Maybe the answer has already been given before, but I couldnt distill it from the great, but sometimes overwhelming amount of info on GDI+, png, etc. that is available on this site
Regards,
Erwin
I decided to post my question on this site after seeing all the impressive work by LaVolte and the many discussions around it.
BACKGROUND
My application allows users to manipulate images on-screen by dragging and dropping them in different locations. To do that most efficiently, it loads initially all images (from files) in a collection (properties: ID, Filename, Picture) and references the collection every time the screen needs to be redrawn. The Picture property in the collection is a StdPicture which is filled with the LoadPicture method, so I limited the image-formats to jpg and emf (for transparency support). The images are drawn on a PictureBox using the PaintPicture method, allowing it to be drawn in a different size than the original.
WISH
I like the application to support png-files incl. transparency. So, I thought to be clever and do that by using GDI+ to load the png-file and then converting it to the StdPicture in the collection, so that I could leave the rest of the application untouched. Unfortunately I lose transparency in that process. :-(
QUESTION
Does anyone have a suggestion how I could achieve png with transparency support while keeping the current structure of my application? Maybe Im oversimplifying, but could it be something like defining the Picture property in the collection as a GDIPlusPicture and using a GDIPlusPaintPicture method to draw them?
Maybe the answer has already been given before, but I couldnt distill it from the great, but sometimes overwhelming amount of info on GDI+, png, etc. that is available on this site
Regards,
Erwin