How I run my business selling software to Americans

Tested under Firefox 3.5.6 and Google Chrome 3.0.195.38
This project extends the technique I created for imprecise line-drawing to create an entire vector graphics application, similar to Inkscape. It is written almost entirely in Javascript, except for a server-side program that renders text.
See below if you are interested in the implementation and coding parts.
The keyboard is the only way to do some things.
C | Start drawing a new curve |
L | Start drawing a new line |
Ctrl+D | Duplicate selection |
Page Up | Move selected shapes toward you |
Page Down | Move selected shapes away from you |
Home | Bring selected shapes to front |
End | Send selecting shapes to back |
Ctrl+G | Group selected shapes |
Ctrl+Shift+G | Un-group selected shapes |
+ | Zoom in |
- | Zoom out |
Shift + | Restore normal zooming |
Arrow Keys | Move around while zoomed-in |
If you don't want to create an account, the "Save" option will also allow you to download your drawing as an image.
Click on the rectangle or circle tool in the toolbar, and the desired shapes will immediately appear in the upper left of the drawing area. You can then drag them to where you want to go.
No two shapes are alike. If you create two circles, they will be slightly different. However, if you duplicate a shape using Ctrl+D, the duplicate will be exactly the same.
To draw a line, click the line tool in the toolbar, then click anywhere in the drawing window to place the first point. You can then click again to place the second point, and so on. To end the line, double click. If you end the line or curve close enough to where you started it, then it will create a closed shape.
Hint: The line tool can be activated by pressing "L", and the curve tool can be activated by pressing "C".
Lines have a sloppiness property that can be set after drawing it. To set the property, select on the line you have drawn. The options pertaining to the line will appear to the left of the drawing window.
Curves do not have sloppiness, but smoothness. By increasing smoothness, the curve is modified to make rounder corners.
Text is placed the same way as circles or rectangles. Click on the text tool, and some default text is placed in the upper left of the image. You can change what the text says by clicking on the text, and then modifying the "text" property that appears to the right of the canvas.
Example: Editing text using the properties area
You can move, scale, or rotate text. However, in this version of the drawing software, scaling will result in loss of quality. Instead, change the font size in the properties area.
While not in line or curve mode, you can select things by dragging a box around them using the mouse. The box must fully enclose the shapes to select them. You can also add a shape to an existing selection by pressing the shift key while clicking it.
Example: Point edit mode
To avoid having to repeatedly select complex groups of shapes, you can "group" the current selection using Ctrl+G. Now, when you click on any one of the group members, all will be selected. You can break apart any selected groups using Ctrl+Shift+G.
I should write something about the implementation. Hmm, the undo stack is pretty standard stuff but may be new to some people. But the thing I was happiest to find was the concept of abstracted Mouse Behaviours.
Design patterns for mouse behaviour are slim pickings. When a novice programmer designs a mouse-intensive application, he or she will tend to make a very complex function that deals with all possible cases when the mouse is clicked or moved. It can quickly grow to be unmaintainable.
To deal with this complexity, we separate the possible states of the system into various MouseBehaviour objects, which implement onMouseDown(x,y), onMouseUp(x,y), and onMouseMove(x,y). (This is a variation on the State design pattern). The default mouse behaviour is the selection mode. If you press the mouse button while over something, it then replaces the default mouse behaviour with a new mouse behaviour. When you lift the button, the new behaviour ends and reverts back to the previous behaviour. This keeps everything simple. There are several mouse behaviours:
We are looking for a simple server side drawing software to add to our web site.
The reason we need it is that we want to have the ability to actually "sign" customers on a web form (using their finger/stylus) using a tablet/smartphone.
We need a simple software with an API that allows the signing/drawing in b/w (no need for colors, brushes, etc...), and saving the image created as a file in our server. The file needs to be saved in a JPG/BMP format.
Do you have something a simple as that ?
Best Regards
Asaf Willensky
Tevel Software
www.tevelsoft.co.il
znorfiq@gmail.com..pls email me as soon as possible
Thanks!
my compliment, maybe you can implement the program in this way , because i have not found the page tht i was looking for.
thnx
good and usefull work
How can we display the properties panel in the embedded version of zwibber ?
Thank you.
here's a tutorial on multiuser sketch pads to get you started...
unionplatform.com/?page_id=2762
colin
First time: saved, closed, tried to reopen - TypeError: a is null
Second time - Blue Screen of Death
Third time - Saved, tried to get pdf, got: TypeError: a is null
Firefox 3.6
why don't you put your invention on github,
so everybody could collaborate on this awesome project
and have like an ass-load of benefits from it?
I created a windows application that behaves in a similar fashion to your application. If you do a search on youtube for procadtivity, you will find 3 or 4 videos showing my application in use. I would be very interested in working with you to create a drawing application that would be faster than anything on the market today. Email:gmyroup@digitalfreehand.com
Springtime Software
You have to press Enter when you finish typing to update the text. But now that you mention it I can see how it is a problem. Thanks for pointing it out.
or perhaps download an SVG
how much are we talking about?
Very good work. Very nice tool.
However rest assured that I am taking all reasonable precautions to keep your saved data available.
You can implement the saving in png option with the function .toUrl(), then ajax the previous content generated to a PHP script with png header in ;)
This makes sketching so much nicer, because it's equally accurate than my drawing, but just looks better.
Wish there was a "real" app like this for everyday offline use.
I'd like to see point editing for curves - I'd be in hog heaven if I could mess with the Bezier curve handles.
I too am interested in license - I'd dearly love to copy this out and hack it into... well, frankly, something that draws spaceships. Some preset objects, a symmetry mode; it's be sweet. Fingers crossed for MIT or such...
I looked at the source and there is not license info... are you planning to release under a standard license?
Nicely implemented.
Really fun to us. The big wow factor for me is that simple cartoons often get the point across better than powerpoints or Omnigraphs which take far more time and energy to produce.
Really marvelous work. If you decide to open source, I would love to help take to the next step (not that it needs to be improved really -- as it stands it's really quite marvelous!); but a couple thoughts I have:
* object linking with a semantic KB?
* overlay planes over a visual backdrop (e.g., photo, screencap)?
* templates?
* Domain specific object palettes?
* layers?
* audio annotation?
dana.moore@bbn.com
I've just discovered your blog and am really enjoying it.
Very cute little webapp.