Page 1 of 1
How to merge two images, keeping alpha channels+++
Posted: Wed Nov 02, 2005 12:30 am
by haerdalis
Hello.. I'm quite new to your library, using just the free version for now,
to see if it fits my needs..
I'm using the GFL SDK (not AX).
How can one merge two images, where one is completely opaque (background), and the other is a PNG with alpha channel, where the
degree of transparency varies (pixel transparency)?
I tried using gflBitBltEx, but that one was rather strange.. Where the
alpha of the upper image dictates transparency, it would completely
erase the image below, replacing it with transparent background.
Somewhat strange because the documentation states the function does alpha blending?
And gflMerge isn't quite there either, since both need to be 100% opaque
where the pixels doesn't say otherwise..
Do you, or anyone else have a good example for displaying a image on screen, which does complete alpha blending with whatever background it is on, or similar?
The standard example doesn't show how to manage something like
this, and doesn't support alpha at all.. (something I'm quite new at I might
add)..
A little note..
Posted: Thu Nov 03, 2005 2:58 am
by haerdalis
I tested the GFLAx, and that one has the function DrawImage, which
does exactly what I want to accomplish.. I.e when drawing one .png (semitransparent/with transparent sections) image on top of another, the lower are visible where the alphatransparency dictates so..
But I use C++ and Delphi, and want to use the gflBitBltEx to do the same.. And that one doesn't..
Instead it copies one image over the other (including alphachannel), but doesn't do any blending, just overwrites..
Is this a bug, or intentionally?
Re: A little note..
Posted: Tue Nov 22, 2005 10:42 am
by xnview
haerdalis wrote:I tested the GFLAx, and that one has the function DrawImage, which
does exactly what I want to accomplish.. I.e when drawing one .png (semitransparent/with transparent sections) image on top of another, the lower are visible where the alphatransparency dictates so..
But I use C++ and Delphi, and want to use the gflBitBltEx to do the same.. And that one doesn't..
Instead it copies one image over the other (including alphachannel), but doesn't do any blending, just overwrites..
Is this a bug, or intentionally?
Strange because DrawImage from GFLAx use gflBitBltEx...
Re: A little note..
Posted: Sun Nov 27, 2005 12:19 pm
by haerdalis
xnview wrote:haerdalis wrote:I tested the GFLAx, and that one has the function DrawImage, which
does exactly what I want to accomplish.. I.e when drawing one .png (semitransparent/with transparent sections) image on top of another, the lower are visible where the alphatransparency dictates so..
But I use C++ and Delphi, and want to use the gflBitBltEx to do the same.. And that one doesn't..
Instead it copies one image over the other (including alphachannel), but doesn't do any blending, just overwrites..
Is this a bug, or intentionally?
Strange because DrawImage from GFLAx use gflBitBltEx...
I agree.. I've tested it some more, and it seems it copies the area specified
to the destination, replacing the destination area with the new imagepart including its transparency, but ignoring what's below (ie no blend)..
I was rather lucky however, as I had some useful functions for operating directly on RGBA data, and blend that way.. Not the best solution however,
since it expects the data in a certain way, and can't operate on those
other mappings..
Re: A little note..
Posted: Sun Dec 04, 2005 1:53 pm
by xnview
haerdalis wrote:xnview wrote:haerdalis wrote:I tested the GFLAx, and that one has the function DrawImage, which
does exactly what I want to accomplish.. I.e when drawing one .png (semitransparent/with transparent sections) image on top of another, the lower are visible where the alphatransparency dictates so..
But I use C++ and Delphi, and want to use the gflBitBltEx to do the same.. And that one doesn't..
Instead it copies one image over the other (including alphachannel), but doesn't do any blending, just overwrites..
Is this a bug, or intentionally?
Strange because DrawImage from GFLAx use gflBitBltEx...
I agree.. I've tested it some more, and it seems it copies the area specified
to the destination, replacing the destination area with the new imagepart including its transparency, but ignoring what's below (ie no blend)..
I was rather lucky however, as I had some useful functions for operating directly on RGBA data, and blend that way.. Not the best solution however,
since it expects the data in a certain way, and can't operate on those
other mappings..
Could you send me the pictures used?