Hi,
I'd like to suggest an easy to use function like ImageConvertToAlphaChannel(#SourceImageID, #DestImageID)
This should then add an alphachannel to a loaded image (like I asked in http://www.purebasic.fr/english/viewtop ... =5&t=40307).
Yes, I know, I may display an non-transparent-image with DisplayAlphaImage() and add the Layer. Would be nicer to have a small function for this...
Also possible ImageChangeDepth(#SourceImageID, Depth). So you would change from e.g. 24Bits to 32Bits in a millisecond, and your picture gets the needed transparency-layer.
ImageConvertToAlphaChannel
-
- Enthusiast
- Posts: 796
- Joined: Tue May 20, 2008 2:12 am
- Location: Cologne, Germany
- Contact:
ImageConvertToAlphaChannel
Regards,
JamiroKwai
JamiroKwai
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
Re: ImageConvertToAlphaChannel
in a millisecond...
but you are aware, that for changing the depth a completely new image object has to be created,
meaning to allocate new mem,
copy the image information partwise (e.g. 3 to 4 byte),
delete the old image,
and by this change the Image-ID ... ?
it is simply not possible to create a new image with the same ID,
and it is not possible to change the depth without creating a new image.
but you are aware, that for changing the depth a completely new image object has to be created,
meaning to allocate new mem,
copy the image information partwise (e.g. 3 to 4 byte),
delete the old image,
and by this change the Image-ID ... ?
it is simply not possible to create a new image with the same ID,
and it is not possible to change the depth without creating a new image.
oh... and have a nice day.
-
- Enthusiast
- Posts: 796
- Joined: Tue May 20, 2008 2:12 am
- Location: Cologne, Germany
- Contact:
Re: ImageConvertToAlphaChannel
Yes. I am aware of this.Kaeru Gaman wrote:in a millisecond...
but you are aware, that for changing the depth a completely new image object has to be created,
meaning to allocate new mem,
copy the image information partwise (e.g. 3 to 4 byte),
delete the old image,
and by this change the Image-ID ... ?
it is simply not possible to create a new image with the same ID,
and it is not possible to change the depth without creating a new image.
What you explained is what I did partially.
The link I proposed shows a code-fragment of a possible solution doing the conversion "manually".
Regards,
JamiroKwai
JamiroKwai