photoshop style zoom tool

Blitz3D Forums/Blitz3D Programming/photoshop style zoom tool

Bolt(Posted 2005) [#1]
I'm doing a basic 2d paint app and have got stuck trying to figure how to make a zoom tool.

I've been drawing the pixels on to a buffer as the user does the painting. Trouble is I can't see how I could take a chunk of the buffer and expand it to fill the window.

Is there a way? Is it blindingly obvious and I'm just being a donkey's arse?


Damien Sturdy(Posted 2005) [#2]
There are a few in 3d, I'd do it using 2d in 3d and z-positioning, however, Thisd be slow as you would be relying on a texture. In pure 2D, i dont know, but i do know resizing images is dog-slow.


Bolt(Posted 2005) [#3]
hmmm. did a quick test at work and seems i can draw to the buffer, do "EntityTexture" and assign tex to a mesh and then view in 3D.

All this in real time doesn't seem noticably slower than merely displaying in 2D and i can zoom in to my hearts content.

Thanks for the hint Cygnus.


Damien Sturdy(Posted 2005) [#4]
Ahh yes, modify the buffer, and transfer it to a texture.. Thatl work and be nice n speedy!


big10p(Posted 2005) [#5]
The way I've done it in the past in 2D, is to not actually display the buffer you're drawing on, but read the pixels and draw a solid rect (same colour as pixel) for each one. The size of the rects can vary according to zoom level.

I guess this method might not be ideal if you have a large zoom window, and you're redrawing the entire screen every frame.