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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 What is the Fastest Brush With ImageEn

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
w2m Posted - Aug 13 2015 : 13:05:13
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
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Aug 14 2015 : 05:43:20
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