Re-Size Picture

Is there a way to re-size or re-dim a picture once created?

I am creating a picture when the window opens. But then I read in some data, and draw it to the picture, and put it on a canvas. If there is a lot of data, I need to make the picture bigger, and then scroll it on the canvas. I don’t know how much data is present until I read it in and process it. So I need to change the picture size on the fly.

As a workaround I am making the canvas 4 times wider than the actual canvas width, and then when I draw the picture to the graphic, I can trim it down to size. But this seem inefficient, clumsy, wasteful of memory, and it fails to address the situation where I need to have 5 or 6 times the width if there is a lot of data.

Can you not test the size of the data first and then create the picture the correct size?

To create a larger picture you would have to make a new picture and then draw the old one into it, at a location the make sense for your need for new area.

I just finished an iOS app that draws a picture using a bunch of methods for each component you can draw. Each method uses a global Scale variable in the drawing commands. Couldn’t figure out how to get pinch to work, so I use +/-buttons to change the size of the image. When a scale button is pressed I clear out the image, change the Scale variable, and redraw everything.

Each component has an x,y (upper left corner) point to locate it.

The drawing commands also use a global offset point so I can drag the image around in the picture, again redrawing everything.

Makes for complicated drawing methods, but it works.