ImageBuffer() equivalent?

BlitzMax Forums/BlitzMax Programming/ImageBuffer() equivalent?

Zolyx(Posted 2005) [#1]
Sorry if this has been covered by something else, but I've done a search and can't find anything.

I am wondering how / if it is possible to perform drawing commands such as DrawRect and DrawText upon a separate image (or pixmap), as was possible in Blitz2D using SetBuffer(ImageBuffer(MyImage))? I'm trying to create a very basic GUI engine and would like to render each gadget as an image before drawing it, as it just seems more efficient that way - or would doing the individual draw commands be just as good?


JazzieB(Posted 2005) [#2]
The easiest way would be to draw your images to the backbuffer, as normal, and then use GrabImage() to turn it into an image. As long as your clear the screen and don't use Flip, the user will be none the wiser.


Damien Sturdy(Posted 2005) [#3]
JazzieB. yeah, but thats slooooooooooooooooooooooooooooooooooooooooooooooooooooooooooow......


JazzieB(Posted 2005) [#4]
I agree it could be slow if this was being done every game/app update loop, but I generally use it to generate images internally, so would only be using it at the beginning of my game and nowhere else - so wouldn't be a problem.

Sounds like Prospero is doing something similar, so may work just as well for their project.


D4NM4N(Posted 2006) [#5]
thats ok as long as the backbuffer is bigger than the image, what do we do if we need to acces an imagebuffer > screen?!?


Dreamora(Posted 2006) [#6]
What does the > mean?

You can't access image buffers, in realtime, you have to manually copy pixel over unless you use Indiepaths render2texture which is the only way to draw to textures (which images are) in realtime.


Warren(Posted 2006) [#7]
What does the > mean?

Greater than. Meaning an imagebuffer larger than the screen.

I guess.


smilertoo(Posted 2006) [#8]
there was a module released that allowed this....from the same people that did the glowing lines thing.


Dreamora(Posted 2006) [#9]
Indiepath.r2t, yes
Not available anymore as people trashed his mailbox with support questions although the code was "as is".


d-bug(Posted 2006) [#10]
Your wrong, Dreamora! It's still there :
http://www.blitzbasic.com/Community/posts.php?topic=60428

... and you've seen this thread ?! :O
cheers


Dreamora(Posted 2006) [#11]
Ah you are right, that thread still exists. (didn't think of it anymore)
But the download with the source and the license isn't online anymore, so we actually don't know what "License: Indiepath License for non warranted software" means.


tonyg(Posted 2006) [#12]
Indiepath module forums


Dreamora(Posted 2006) [#13]
Cool, they are up again? :-)