10-18-2005, 10:07 PM
How do you use imagecreate if you wanna create a array with more than one index?
Like
DIM Sprite(1, 64) AS USHORT
Like
DIM Sprite(1, 64) AS USHORT
ttp://hem.passagen.se/qb.basta
IMAGECREATE
|
10-18-2005, 10:07 PM
How do you use imagecreate if you wanna create a array with more than one index?
Like DIM Sprite(1, 64) AS USHORT
ttp://hem.passagen.se/qb.basta
10-19-2005, 01:30 AM
Code: Dim Sprites(0 To 9) As Any Ptr
10-19-2005, 01:33 AM
Code: Dim ImgArray(50) as any ptr EDIT: Damn jofers!
10-19-2005, 01:35 AM
The deallocation command is "ImageDestroy", not "ImgDestroy", but you are essentially correct.
10-19-2005, 02:13 AM
Thanks you two, I've also been wondering this same thing. 8)
10-19-2005, 02:22 AM
Quote:The deallocation command is "ImageDestroy", not "ImgDestroy", but you are essentially correct.Thanks, fixed.. I always make that misstake.. ..
10-19-2005, 12:54 PM
gah! This isn't working for me..
In my engine i use gfx routines that are made using sprites dimed as ushorts.. Using sprites made using IMAGECREATED won't work in them routines. I however have nothing against doing it manually then this is a totally new question: I while back i leared that to declare a sprite as ushort in 16 bit mode i would use: ((Wid*Hei*2)+2) It works fine but i can skip that *2 and it still works so i guess i have done the calucation wrong. How exactly is it supposed to be?
ttp://hem.passagen.se/qb.basta
10-19-2005, 03:20 PM
its ( ( ( w * h ) \ 2 ) + 2 )
10-19-2005, 05:45 PM
Quote:its ( ( ( w * h ) \ 2 ) + 2 )ONLY if he's using integer. Which he isnt. QbBasta: ((Wid*Hei*2)+2) is somewhat correct, the size in bytes is: W*H*2+4 for a 16 or 15bit image, for 24 and 32 it's W*H*4+4, and for 8 or less it's W*H+4 If diming the sprites AS USHORT, then you take the bytesize and divide it by 2 For a 15 or 16bit image, this means: W*H+2 And as FB start on array index 0: W*H+1 To use multi dimensional arrays with GET/PUT you can do: Code: Dim myArray(10, W*H+1) as USHORT
10-20-2005, 01:01 PM
oh, my bad.. man.. everytime someone asks someone like this.. i revert back to qb mode and give the answer for 8-bits xP
|
« Next Oldest | Next Newest »
|