• Welcome to Powerbasic Museum 2020-B.
 

News:

Forum in repository mode. No new members allowed.

Main Menu

What is the best way to use png with transparency?

Started by Randall Glass, August 30, 2013, 04:16:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Randall Glass

I would like to load a png to the screen, and blend on to the screen, a png with alpha transparency.

What would be the best way to do this?

What is the best, and easiest library to use for this?

Lassar

RadioTelephone Tutor : Get your FCC GROL License plus Radar Endorsement
http://radiotelephonetutor.com

Patrice Terrier

You need a graphic Library that is able to work in composited mode, very few indeed ;)
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Brice Manuel

Quote from: Randall Glass on August 30, 2013, 04:16:13 AM
I would like to load a png to the screen, and blend on to the screen, a png with alpha transparency.

What would be the best way to do this?

What is the best, and easiest library to use for this?

GDImage.  It should be an industry standard (it is that good).

Patrice Terrier

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Edwin Knoppert

Ordinary Windows gdiplus..

On my site: http://www.hellobasic.com/ you can find iconbrowser.
When you load an icon with png image (App004.ico 32bit 256x256 for example)) you can see the drawing in action in the center part of the app.

Patrice Terrier

#5
Edwin,

QuoteOrdinary Windows gdiplus..
No, it is not related to gdiplus, but to the layered composited mode. However because Windows icon based on png are rendered in composited mode the result looks the same, but for smaller images.

To display large image with variable opacity, you need to resort on DWM (AERO mode) and render the drawing onto the DirectDraw surface, at least this is what i am doing. This is also what does D2D, all the hard work being done by the GPU.

Added:
This HUD window is a good example of GPU composited mode

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com