Fran Verona
Fran Verona

Reputation: 5476

Infinite Canvas in Flex

I'm developing a web app using Flex. This app allows to draw forms in a Canvas (like MSPaint in Windows).

Now, I want a new feature on it: an infinite canvas. The user should be able to drag the main Canvas and this should be infinite in X and Y axis. Consecuently, this Canvas should be resized in real time.

Obviously, I don't want to create a Canvas of 1k x 1k pixels with zoom in an specific area to give the feeling of an infinite drawing area.

How could I achieve it? Any suggestions or ideas are welcome :)

EDIT:

I just read that Flash/Flex Flash/Air supports canvases up to 4056x4056 px, not infinite.

Upvotes: 0

Views: 227

Answers (1)

Marty Pitt
Marty Pitt

Reputation: 29290

You might want to reconsider how you implement your infinite canvas - a single, ever growing canvas, is likely to cause performance issues.

Instead, consider breaking your canvas into virtual canvases of fixed size (I'd recommend much smaller than the max of 4056x4056), and then stitch them together at runtime, as the user pans around.

Upvotes: 1

Related Questions