I don't usually ask for help, but I'm really getting kinda stumped on this one:
I want to create a function to fade between two images. I am using DBV1. I want to use memblocks to make the transition, but I've gotten stumped with getting rgb values from 16-bit images (24-bit would allow rgb() function to work correctly)
Heres what I've researched so far (spent most of my day off doing it)
Word's return 2-byte data (0-65535) or 16-bits (hence 16-bit images)
I've read that you have to bitshift to get the three components of rgb from http://www.darkbasicpro.com/apollo/view.php?t=6448&b=2. I think I understand that values will lose 8-bits (from 24-bit) in that the values will not be (0-255) instead (0-31) or 256 / 32 = 8. So the values converted into rgb would run like this: 0,8,16,24...255. However, I cannot find a way to do bitshifting in db without converting the decimal into strings, (which is obviously inefficient). I have not used binary in DB before but I understand how to read it. I have no problem making the interpolated transition, but I need to get over this hump to make it possible.
My questions are as follows:
1. Can DB write 24-bit images to memblocks with dwords (3-bytes) instead of words(2-bytes)? Hence no conversions need be made for rgb components.
2. Does anyone have clean functions similar to DB's built in RGB,RGBR,RGBG,RGBB that take in a number from 0-65535 and return correct rgb components?
Thank you all for your help in advance!
TH -Darksoft.net
http://www.darksoft.net/sigpic.jpg[/img]