Alpha supported ?
Alpha supported ?
Hi !
Are the alpha channel supported in PB4 ?
I've searched in the help but haven't found...
Are the alpha channel supported in PB4 ?
I've searched in the help but haven't found...
-
Steve Elliott
- Enthusiast

- Posts: 109
- Joined: Sun Jan 01, 2006 9:34 pm
- Location: Wales, UK
Code: Select all
texture = LoadSprite(#PB_Any,"filename.png",#PB_Sprite_Texture | #PB_Sprite_AlphaBlending)
CreateSprite3D(3dsprite,texture)
Start3D()
Sprite3DQuality(1)
DisplaySprite3D(3dsprite,x,y)
Stop3D()
Project S: loading...
Intel Core2 Duo E7200 @ 2.53Ghz, 3Gb RAM Intel G45 Express
Intel Core2 Duo E7200 @ 2.53Ghz, 3Gb RAM Intel G45 Express
- netmaestro
- PureBasic Bullfrog

- Posts: 8452
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
DrawAlphaImage() will render the alpha channel in png and tiff image formats. It works for 2d non-sprite images.
Last edited by netmaestro on Tue Feb 21, 2006 2:33 pm, edited 2 times in total.
BERESHEIT
-
Steve Elliott
- Enthusiast

- Posts: 109
- Joined: Sun Jan 01, 2006 9:34 pm
- Location: Wales, UK
Interesting, didn't realise that netmaestro - but surely it will be quicker using hardware acceleration for this type of task?
I'm using 3DSprites because I do need it in my program for scaling and rotation.
I'm using 3DSprites because I do need it in my program for scaling and rotation.
Last edited by Steve Elliott on Sat Feb 11, 2006 11:13 am, edited 1 time in total.
Project S: loading...
Intel Core2 Duo E7200 @ 2.53Ghz, 3Gb RAM Intel G45 Express
Intel Core2 Duo E7200 @ 2.53Ghz, 3Gb RAM Intel G45 Express
- netmaestro
- PureBasic Bullfrog

- Posts: 8452
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
If you use the Point(x,y) command on a pixel in the transparent area of an image loaded with an alpha channel it returns a color equal to RGB(0,0,0) or #Black. You wouldn't be able to distinguish this from actual black areas of the image using Point(x,y) Is that what you want to do?
Last edited by netmaestro on Tue Feb 21, 2006 2:31 pm, edited 3 times in total.
BERESHEIT
In short, alpha channel is not supported ?netmaestro wrote:If you use the Point(x,y) command on a pixel in the transparent area of an image loaded with an alpha channel it returns a color equal to RGB(0,0,0) or #Black. You wouldn't be able to distinguish this from actual black areas of the image using Point(x,y) Is that what you want to do?
No, I need to get the alpha color of a pixel...
But anyway, since the Point function is slow...
Well I guess I'll stick to my homemade images functions....
Er, what exactly should work ?Fred wrote:You can still give it a try, it should work.
If you mean getting the alpha front the color returned by Point, then no, it's not working, I use this :
Code: Select all
Procedure Alpha(color)
ProcedureReturn PeekB(@color+3)&$FF
EndProcedure
Out of curiosity, how would you go about getting the alpha value from point? "And" it with $FF000000, for example?
But
Uses up all the values. Eg, for yellow = $0FFFF get 255 - 255 - 0 debug results, with nothing left.
But
Code: Select all
k = Point(x,y)
Debug Red(k)
Debug Green(k)
Debug Blue(k)@}--`--,-- A rose by any other name ..

