Loading an image here with PB's image library, and I wanted to know how to access the pointer to the image data in memory?, I don't know how this data is stored by the lib, but I hope this helps me in my project. As if I get the pointer, things can be faster enough to be worth the try.
I don't have the answer (sorry) but I have a similar question for anyone who's
reading: how to get the MD5 checksum of the image data in the clipboard?
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Yes, this information would be valuable to me as well because I'd like to write my own sprite drawing routines and this would make it much faster than using the usual method (using built-in PB commands to copy-modify-copy, etc).
I'm sure, internally, PB keeps things like that in a structure of some sort, so we just need access to that structure. Hey, we can get the address of the video memory, variables, labels and functions so we're almost there!
How about it, Fred?
Russell
*** Diapers and politicians need to be changed...for the same reason! ***
*** Make every vote equal: Abolish the Electoral College ***
*** www.au.org ***
Nice to hear I'm not the only one that needs this hehe.
I thought it was a whim of mine... But it makes sense if you think about it.
Right now I'm reading every pixel of the image and storing it into an array, tell me if it wouldnt be faster to simply access the image data which is in memory?.
Loading a big image takes no time, the problem in my case is having to read every pixel and store it into an array, thats the slow-downer.
It should be possible to get this pointer (im asking myself as well)...
PB: clipboard? but when you load an image using LoadImage() does it end up in the clipboard? I thought the clipboard was for other things... If you want to get the checksum of the image in memory, why doing this? I mean you can get it from the disk (okey maybe you want a very secure method instead?, if its for a watermark or something like that I can tell of a better method, if not it's maybe a whim ).
> PB: clipboard? but when you load an image using LoadImage() does it end
> up in the clipboard? I thought the clipboard was for other things
I'm not interesting in loading an image. My question is not the same as yours.
It's similar, but not the same. We both want to get image data from memory,
but my memory is the clipboard.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Structure PB_StructureDataBase
Bitmap.l ; OS Bitmap pointer (HBITMAP)
Width.w ; Width in pixel of the image
Height.w
Depth.w
ColorArray.l ; Memory pointer on a color array for 256 colors pictures
EndStructure
Yup I tried but my real problem comes with the color array, it seems empty.
And i've seen someone got the same exact problem before (empty array, well, at least it returns a null).
You know it's supposed to be like this if you're not using 8bit images, right?
EDIT: Ah no, I think I remember now, there was something with PB converting
every image to the screens' bit-depth. I tried it myself, opening an 8bit
bitmap and 'depth' said 32...
Last edited by traumatic on Mon Apr 18, 2005 1:07 pm, edited 1 time in total.
Good programmers don't comment their code. It was hard to write, should be hard to read.
No I don't, where is the image data allocated at?
Thats my first question which answer still I don't know
And thanks for your time You always seem to pop up when I have a question You might be a vip member of the forum!
Edit: ah edits!!, Didnt seen your edit!, and also I didnt knew PB converted to the current depth, thats odd. Still Im wondering wheres all this data allocated at.