Re: Free Hand Drawing
"Rory Daulton" <[email protected]> Wed, 13 Aug 2003 14:02:54 -0400
| Newsgroups | gmane.comp.lang.delphi.programming |
|---|---|
| Message-ID | <003601c361c5$1f1928e0$6401a8c0@laptop> |
Jorge,
> Thanks Rory, but that is essentially what the TCanvas methods do. I
> used an ellipse as an example but basically I just need to be able to
> draw any type of figure freehandedly. I simply need to learn how to
> draw directly on the canvas freehand. Even draw a swirl pattern if
> necessary. Pretty much the way MS Paint works.
OK, I understand now. You want something like the Brush tool in MS Paint.
Look at the Graphex demo that comes with Delphi as a starting point. You
would want to add another SpeedButton next to the line/rectangle/etc. to
represent the brush tool. The main code change would be to add another case
inside the TForm1.DrawShape procedure, something that would use the pen size
setting for the size of the point drawn, such as:
dtBrush:
begin
Image.Canvas.MoveTo(BottomRight.X, BottomRight.Y);
Image.Canvas.LineTo(BottomRight.X, BottomRight.Y);
end;
You would also need to modify TForm1.FormMouseDown to draw a point when the
mouse button is pressed (and the Brush tool is selected) and
TForm1.FormMouseMove to just draw the new point and not erase the previous
point (again if the Brush tool is selected). This should be fairly
straightforward. Ask if you have any more questions.
Rory Daulton
[email protected]
---
[This E-mail scanned for viruses by Declude Virus and Nmax "Your MAXimum Connection!"]
[This E-mail scanned for spam by Declude JunkMail and Nmax "Your MAXimum Connection!"]
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/i7folB/TM
---------------------------------------------------------------------~->
CodeCoffer - new Delphi code protection Tool!
http://www.delphicollection.com/public/CodeCoffer.htm
---------------------------------------------------------------
Unsubscribe:[email protected]
List owner:[email protected]
---------------------------------------------------------------
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/