I'll be putting a website up when it's ready to go. I'm awfully excited
about it, so since you asked I'll toot my own horn for a second.
It's a tool that acts like most popular vector based drawing tools. There's
a rectangle tool, rounded rect, ellipse, line, pen (bezier supported), text,
fill, dropper, image placer, etc. Similar to Macromedia Fireworks, each
object has a stroke and a fill. Strokes translate to drawing with pens and
fills to filling with any of the various brushes (solid, gradient, hatch, or
texture).
With it you can create either a new printdocument or a new surface (form,
control) and start drawing on them. The only real difference to the tool
between the two is that a printdocument's size is determined by printer
options and supports a set of pages, whereas the user specifies width and
height for a control.
There are two ways to get at the GDI+ (System.Drawing) code, and both
strictly use the CodeDOM to generate managed code so its VB and C#
compatible. One is through an export option which gives you a skeleton of
declarations and a series of method calls in onPaint for controls, or a
onprintpage override for printdocuments. If it needs it, as it does with
pens with dash caps, etc, it creates an "initializecomponent" like method to
assign properties. It does its best to stay out of the way of the "meat" and
just draw things. The second way is, you can get a context menu on any
object on your surface and select "quick view code" and it will give you the
code for just that object. This is useful if you don't want to try and
manually figure out the points in a complex path for example.
The code generated depends on the type of object used to create it, and uses
all built in system.drawing features (there's no assembly dependency to
anything I've written). Simple objects like rectangles, lines, ellipses,
etc go straight to what you would guess they would. The pen tool is more
complex and creates a graphicspath, and the text tool runs the entire gamut
creating a stringformat, font, etc. I think seeing the generated code will
help clarify.
Finally, along with code generation, you can export your drawing work to all
the graphics formats supported by the framework (png, tiff, jpeg with
reduction, and GIF with fixed palette sizes, bmp). I added that because...
I'm still trying to figure out why I added that. Seriously, I thought it
was nice to be able to export it for documentation purposes.
There's only three big downers. Downer one - it does not run in the IDE
because I could not figure out how to get the toolbox to work the way I
wanted to for the pen tool. Downer two - it's one way at the moment. You
can't take a code file and bring it back into the tool, though you can save
your drawings to the properietary format. Downer two will be fixed in a v1
upgrade, but I want to get it out now. I don't see it ever being IDE
integrated unless someone much more clever than me comes on board.
Downer three - it assumes a fixed format printdocument. It's not a Crystal
report alternative. I really created it because I kept getting these
projects where I needed to take some information over the web / through a
device, get it to a database, and later produce a printed form. After
frustration with exporting to Word to just print a document, I looked at the
printdocument object. It's wonderful, but I knew if I had to manually
figure out where all the boxes went, and where all the text should be drawn,
I might as well write a tool to do it instead.
In terms of adding CF code generation - most of it would be disabling things
such as being able to pick a pen width and most of the brush options.
Certain things like text would have to rethought completely, however.
Anyway, that's the long answer. Glad you asked : )
German Bauer said:
your tool sounds interesting, and it would be great to have it extend
to CF. Is there more info on what you're building?
+ G
"Justin Weinberg" <
[email protected]> wrote in message
CF.