123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|741|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Saving Alpha Information To An Image

Wed, 08 Aug 2007, 10:29
mike_g
I made some code to create a bumpmap of an image which works. I have a problem trying to save it to the high 8 bits of the image tho. As far as I can tell my code seems as if it should work. Is this not possible or something, or am I doing something wrong here? To run the code you need an image (preferably small) called 'test.bmp' in the same directory.

Wed, 08 Aug 2007, 10:51
JL235
BlitzBasic doesn't support alpha components in images.

|edit| After just testing it seems the alpha is always 255. Even after writing a number there. |edit|
Wed, 08 Aug 2007, 13:08
mike_g
Umm, yeah that kind of sucks dosent it :/ Oh well I guess I code recode it in C using SDL.
Wed, 08 Aug 2007, 13:53
JL235
If you can draw to texture buffers then you could use them. They support alpha channels. You could also make an array the same size as the image and use that to store the info. Or just make a second image and draw the greyscale bump mapping straight to it and miss out the alpha channels completely.
Wed, 08 Aug 2007, 15:23
Jayenkai
What exactly are you doing with the image afterwards?
Leaving it in memory, or just using Blitz to create the alphas, for use in another project?

-=-=-
''Load, Next List!''
Wed, 08 Aug 2007, 15:27
mike_g
@ Diablo: Yeah, I noticed that in the help file. I might have a play around with creating texture and see if that works.

@Jay: I hadent really thought about that yet. Its just something I was playing around with for fun.
Wed, 08 Aug 2007, 15:33
Jayenkai
Your code works..


Blitz DOES work with Alphas.. It just doesn't PLAY with alphas..
And it also won't save them either.. Not sure about loading.
So I grabbed a SaveTGA snippet from BB.com, and it's sorted.

-=-=-
''Load, Next List!''
Wed, 08 Aug 2007, 15:57
mike_g
Nice one, cheers dude