PDA

View Full Version : Paint Tool



umr.ashrf
12 Dec 2012, 10:49 AM
I'm thinking of developing a MS Paint like tool in ExtJS and as I was up to planning of this tool, I got several questions.

I know ExtJS can draw things inside a Component and they can be added as floating components to a Absolute layout container. They can be draggable and resizable.

1. Now the question is if user wants to save the whole work in image formats (PNG, BMP, JPEG, GIF etc), how can a Absolute layout container do that? That's really not possible, right?

2. What if user wants to zoom things out and in? He can do that with transform: scale(2) but that's CSS3 and there doesn't seem any cross compatible way of doing this. Right?

skirtle
12 Dec 2012, 8:48 PM
Surely something like this would be done using the drawing package (Ext.draw.*) rather than using floating components?

For exporting a drawing to an image file see:

http://docs.sencha.com/ext-js/4-1/#!/api/Ext.draw.engine.ImageExporter

umr.ashrf
13 Dec 2012, 2:34 AM
The reason I was using floating components is because many of the functions are built into it.

For example.

component.toBack()
component.toFront()
draggable
resizable
etc

If I draw everything on a single surface, I would need to write these functions myself. What do you say?