Search results for 'DrawMarquee'. 1 post(s) found.
- 2007/09/11 Implementing a lasso drawing technique
Here's one approach to drawing a lasso rectangle using Delphi:
1. In the OnMouseDown event for the form
that you are 'lasso-ing' controls on:
bMarquee := True;
ptOrigin := Point(X,Y) ;
ptMove := Point(X,Y) ;
Pen.Color := clBlack;
Pen.Width := 1;
Pen.Style := psDash;
Brush.Style := bsClear;
DrawMarquee(ptOrigin, ptMove, pmNotXor ) ;
ptOrigin := Point(X,Y) ;
ptMove := Point(X,Y) ;
Pen.Color := clBlack;
Pen.Width := 1;
Pen.Style := psDash;
Brush.Style := bsClear;
DrawMarquee(ptOrigin, ptMove, pmNotXor ) ;
2. In the OnMouseMove event for the form...
if bMarquee = True then begin
DrawMarquee(ptOrigin, ptMove, pmNotXor) ;
DrawMarquee(ptOrigin, Point(X,Y), pmNotXor) ;
ptMove := Point(X, Y) ;
Canvas.Pen.Mode := pmCopy;
end;
DrawMarquee(ptOrigin, ptMove, pmNotXor) ;
DrawMarquee(ptOrigin, Point(X,Y), pmNotXor) ;
ptMove := Point(X, Y) ;
Canvas.Pen.Mode := pmCopy;
end;
3. In the OnMouseUp event for the form...
if bMarquee = True then begin
bMarquee := False;
DrawMarquee(ptOrigin, Point(X,Y), pmNotXor) ;
ptMove := Point(X,Y) ;
end;
bMarquee := False;
DrawMarquee(ptOrigin, Point(X,Y), pmNotXor) ;
ptMove := Point(X,Y) ;
end;
4. The DrawMarquee procedure...
procedure myForm.DrawMarquee
(mStart, mStop : TPoint; AMode : TPenMode) ;
begin
Canvas.Pen.Mode := AMode;
Canvas.Rectangle(mStart.X,mStart.Y,mStop.X,mStop.Y) ;
end;
(mStart, mStop : TPoint; AMode : TPenMode) ;
begin
Canvas.Pen.Mode := AMode;
Canvas.Rectangle(mStart.X,mStart.Y,mStop.X,mStop.Y) ;
end;
Another posts included in "Delphi"
| Is Point in Polygon? (0) | 2007/09/11 |
| Paint a Form with a tiled bitmap image (0) | 2007/09/11 |
| Rotating Text (0) | 2007/09/11 |
| Grayscaling a bitmap ? (0) | 2007/09/11 |
| Get Cursor Image (draw it on a Canvas) (0) | 2007/09/11 |
| How to convert HIcon to TIcon ? (0) | 2007/09/11 |
| Extract an icon from an Windows application and paint on a Form (0) | 2007/09/11 |
| How to draw transparent text on Windows Desktop (0) | 2007/09/11 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 04:55
moneyideas
-
Subject different money making ideas
2010/01/29 13:45
moneyideas
-
Subject different money making ideas
2010/01/31 16:39
moneyideas

Prev

Rss Feed