ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 What is the Fastest Brush With ImageEn
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

w2m

USA
1990 Posts

Posted - Aug 13 2015 :  13:05:13  Show Profile  Reply
procedure TForm1.DrawBrush(X: Integer; Y: Integer);
{ Draw a brush with TIECanvas - GDI PLus. }
var
  iIECanvas1: TIECanvas;
  iIECanvas2: TIECanvas;
begin
  iIECanvas1 := TIECanvas.Create(ImageEnView1.Layers[ImageEnView1.LayersCurrent]
    .Bitmap.Canvas, False, False);
  iIECanvas1.Pen.Style := psSolid;
  iIECanvas1.Brush.Color := clBlack;
  iIECanvas1.Brush.Style := bsSolid;
  iIECanvas1.Brush.Transparency := 255;
  iIECanvas1.Brush.BackTransparency := 255;
  iIECanvas1.Ellipse(X - 5, Y - 5, X + 5, Y + 5);
  iIECanvas1.Free();
  ImageEnView1.Update;
  { Alternate }
  iIECanvas2 := ImageEnView1.Layers[ImageEnView1.LayersCurrent]
    .Bitmap.CreateROICanvas(Rect(X - 5, Y - 5,
    X + 5, Y + 5), True, True, False);
  iIECanvas2.Pen.Style := psSolid;
  iIECanvas2.Pen.Color := clBlack;
  iIECanvas2.Brush.Style := bsSolid;
  iIECanvas2.Brush.Color := clBlack;
  iIECanvas2.Ellipse(Rect(X - 5, Y - 5, X + 5, Y + 5));
  iIECanvas2.Free();
  ImageEnView1.Update;
end;



Both of these brush drawing methods produce dotted drawing when the mouse is moved faster than a snails pace regardless of the settings used. What is the best way to draw a brush so that the drawing can be smooth (no dots)? In my case I can not use the RenderToTIEBitmapEx and MergeAlphaRectTo methods because all the layers have an image. Is there another fast way to do this?

I am beginning to think a threaded FastBrush drawing method needs to be added to ImageEn.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development

xequte

38514 Posts

Posted - Aug 14 2015 :  05:43:20  Show Profile  Reply
Hi Bill

Are you calling DrawBrush() directly from on MouseMove? If so, you will be calling update too frequently and it will slow things right down. Try calling update only a few times per second.

If that is still not enough, then you might try connecting the last point to the current one (i.e. draw a line)

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: