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
 Bezier curves

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
bmesser Posted - Oct 22 2013 : 02:23:02
Hi

Although I'm trying to do this using ImageEN it's more a generals graphics problem and more a plea for help!

I have a weather chart resplendent with all the isobars and on top of this I would like to draw weather fronts. I've seen the Painter demo and how you can draw polygon lines with it. What I would like to do is to pick a series of points to mark out a front and instead of straight lines joining the points up, I would like to produce a nice smooth Bezier curve. I have just started to trawl the internet for information on how to do this, and have already checked the ImageEN help on the subject but didn't find much.

Any help would be much appreciated.

Bruce.
2   L A T E S T    R E P L I E S    (Newest First)
bmesser Posted - Oct 22 2013 : 07:35:26
Thanks Bill - I'll have a look and let you know.
w2m Posted - Oct 22 2013 : 05:44:35
You might try using IEGDIPlus.pas.

It has quite a few ways to draw curves.
procedure Arc(X1, Y1, X2, Y2, X3, Y3, X4, Y4: Integer);
procedure Polyline(Points: array of TPoint);

Here is how to use it:
procedure TForm1.Button2Click(Sender: TObject);
var
  iIECanvas: TIECanvas;
  iBrushWidth: integer;
  iBrushColor: TColor;
  iBrushAlpha: integer;
  iPoints: array of TPoint;
begin
  iIECanvas := TIECanvas.Create(ImageEnView1.Layers[ImageEnView1.LayersCurrent]
    .Bitmap.Canvas, AntiAlias1.Checked, UseGDIPlus1.Checked);
  iBrushWidth := StrToInt(BrushSize1.Text);
  iBrushColor := BrushColor1.Selected;
  iBrushAlpha := StrToInt(BrushAlpha1.Text);
  iIECanvas.Pen.Style := psSolid;
  iIECanvas.Brush.Color := iBrushcolor;
  iIECanvas.Brush.Style := bsClear;
  iIECanvas.Brush.Transparency := iBrushAlpha;
  iIECanvas.Brush.BackTransparency := iBrushAlpha;
  SetLength(iPoints, 5);
  iPoints[0] := Point(0, 0);
  iPoints[1] := Point(50, 75);
  iPoints[2] := Point(75, 50);
  iPoints[3] := Point(25, 70);
  iPoints[4] := Point(0, 0);
  iIECanvas.Polyline(iPoints);
  iIECanvas.Free();
end;

You can also draw on the alpha channel.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html