Need suggestions for drawing selection quad.

BlitzPlus Forums/BlitzPlus Programming/Need suggestions for drawing selection quad.

In my app, I am displaying a texture on a canvas.

I need to allow the user to zoom in, and to do that I'm manually changing the size of the canvas with windows GDI calls. Why am I doing this? Because scaling a canvas in this way is instantaneous, plus you get bilinear filtering when scaling up, and antialising when scaling down, for free.

But there's one little problem.

Over one of these canvases I need to draw quad which can be any shape.

This quad needs to be drawn with a marquee/marching ants style for the lines. Ie, black and white dashes that move along the line.

The quad also needs one red vertex at each corner.


Now, I was drawing this quad to my canvas and that was working great, until I found out that zooming images by directly manipulating the data on the canvas was extremely slow.

So I changed to the manual resize canvas option, but now I have a problem.

I can't draw my quad to my canvas anymore, because it will be scaled with the canvas.


Now, if I could draw a second canvas over the first, and enable some kind of masked drawing, that might work. But it would have to be fast.

Unfortunately I don't even know what a "canvas" in Blitz really is in windows. It's certainly not called a canvas on MSDN...

The second option would be to draw lines. I found a command called LineTo, but it wants a "device context" for the window or whatever that I want to draw my lines to. Even if I could get the device context for my main window, I'm not sure that these lines would actually draw over my canvas. Also, in order to draw my marching ants, I would have to draw hundreds of individual lines all around the border of my qaud, and I'm not too sure that's going to be very fast.


So does anyone have any suggestions here for how I can accomplish what I'm attempting to do?