[Implemented] Loading the PNG Alpha-Channel

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

[Implemented] Loading the PNG Alpha-Channel

Post by freedimension »

It seems as though the alpha-channel of a PNG is not loaded into memory. Could that be fixed for the next version?
P.S.: No, I'm not talking about displaying this alpha-channel with DrawImage.
robink
User
User
Posts: 26
Joined: Sat Jan 03, 2004 7:25 pm
Location: Rinteln
Contact:

Post by robink »

I think loading and Displaying the AlphaChannel would be a very cool feature!
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

This would be very cool! I would love to display graphics on apps (using the image gadget) with nice blended edges instead of hard bitmap type edges. Hard bitmap edges look so crap when people start changing the windows to their prefered colour.
--Kale

Image
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

See here:

viewtopic.php?t=10190&start=15

Though it does not load the alpha-channel of a PNG automatically, it's the result that does matter and not the how, isn't it?
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

Kale wrote:This would be very cool! I would love to display graphics on apps (using the image gadget) with nice blended edges instead of hard bitmap type edges. Hard bitmap edges look so crap when people start changing the windows to their prefered colour.
As the image-gadget is a Window, this is IMHO not possible.
Kris_a
User
User
Posts: 92
Joined: Sun Feb 15, 2004 8:04 pm
Location: Manchester, UK

Post by Kris_a »

It would probably be possible if you drew directly to the window's DC
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

See here:
viewtopic.php?t=10190&start=15
Though it does not load the alpha-channel of a PNG automatically, it's the result that does matter and not the how, isn't it?
Does your lib provide a way of loading a grayscale alpha channel for use as a transparency mask for an image like .png? Or does it just provide a way of just selecting 1 colour to make transparent (which is what i don't want). :?:
--Kale

Image
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

There are two functions X2D_DrawTransparentImage and X2D_DrawAlphaImage. The first will "cut out" a single color, the second can do Alpha-Transparency with and without masks. For more detail just download the 30k ;-)
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

There are two functions X2D_DrawTransparentImage and X2D_DrawAlphaImage. The first will "cut out" a single color, the second can do Alpha-Transparency with and without masks. For more detail just download the 30k
*STUNNED* 8O Very nice work freedimension, X2D_DrawAlphaImage is (for me) a wish come true! :D
--Kale

Image
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

Kale wrote:*STUNNED* 8O Very nice work freedimension, X2D_DrawAlphaImage is (for me) a wish come true! :D
Don't forget to read the license ;-)
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

freedimension wrote: Don't forget to read the license ;-)
:lol:
Post Reply