GetPixel

Monkey Targets Forums/Desktop/GetPixel

FBEpyon(Posted 2013) [#1]
Hello All,

I really need help with something, I need a way to do getpixel I want to load a Heightmap from a image.. PLEASE HELP!!

Thanks,


Midimaster(Posted 2013) [#2]
1.
you have to draw the image onto the screen in OnRender().
2.
Then you can use ReadPixels() to copy all Pixels into an array.
3.
After this the array will have exactly the dimensions of the image.
4.
Now you can use all pixel information as INTEGER values.
5.
Finally CLS the screen in OnRender().


FBEpyon(Posted 2013) [#3]
Yeh Knew That..

But the problem is having to do that I wish there was a Pixmap module like BlitzMax, but I was able to figure out what was happening with my stuff..

Thanks,


Midimaster(Posted 2013) [#4]
you can pack all this in a own class... where is the problem?


FBEpyon(Posted 2013) [#5]
I had to remove the SetRender() from MiniB3d, do the calculations, then setup the SetRender() after that to get GetPixel to work..

Thanks.


zoqfotpik(Posted 2013) [#6]
Why not write out the file in some other format (run-length encoding or whatever) and read the map in directly as integers? Sounds easier than futzing around with readpixel.