ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search
 All Forums  ImageEn Library for Delphi, C++ and .Net  ImageEn and IEvolution Support Forum  How to dynamically generate elliptical seats? New Topic  Reply to Topic  Printer Friendly
Author  Topic

China
6 Posts

 Posted - Jun 30 2019 :  11:03:49 @xequteHI.How to dynamically generate elliptical seats and sign names by row and column?Is there a code reference for related examples?

4712 Posts

 Posted - Jun 30 2019 :  23:43:41 The following code will create a 2x3 set of numbered ellipses:``` for I := 1 to 6 do begin // Add a text object ImageEnView1.LayersAdd( 'A' + IntToStr( I ), 14, clBlack, 'Arial', [fsBold]); txtLayer := TIETextLayer( ImageEnView1.CurrentLayer ); if I mod 2 = 0 then txtLayer.PosX := 500 // even number else txtLayer.PosX := 100; // Odd number; txtLayer.PosY := ( I + 1 ) div 2 * 300 + 100; txtLayer.Width := 200; txtLayer.Height := 200; txtLayer.BorderColor := clRed; txtLayer.BorderWidth := 5; txtLayer.FillColor := clYellow; txtLayer.BorderShape := iesEllipse; txtLayer.Alignment := iejCenter; txtLayer.Layout := ielCenter; end; ImageEnView1.Update();```However drawing the text outside the circle (Name* labels in your image) is much harder. You would need to create individual text layers and position them independently.As a starting point to calculate the PosX and PosY for each label, use the OffsetPoint method in hyieutils.Nigel Xequte Softwarewww.imageen.com

China
6 Posts

 Posted - Jul 01 2019 :  04:19:01 Outside Drawing Text Data Fixed must have 10 names, so you see how to solve it? Provide the following example code, thank you.

4712 Posts

 Posted - Jul 01 2019 :  17:23:19 HiPlease show me the code that you have so far to dynamically create the labels.Nigel Xequte Softwarewww.imageen.com

China
6 Posts

 Posted - Jul 01 2019 :  20:58:33 I don't have any code here. How to generate 10 name tags out of a circle with both X and Y axes accurate is a difficult problem for me.

China
6 Posts

 Posted - Jul 05 2019 :  22:46:30 @XequteHow to mark the angle of 0, 30, 60, 90, 120, 150, 180, 210 degrees and coordinates of the circle?

4712 Posts

 Posted - Jul 07 2019 :  00:57:47 The width and height of the circle will be ImageEnView1.Layers[i].Width/Height.So to find a point on the edge of the circle at 30 deg. would be something like:``` lyr := ImageEnView1.Layers[i]; centerPt.X := lyr.PosX + lyr.Width div 2; centerPt.Y := lyr.PosY + lyr.Height div 2; ptOnEdge := OffsetPoint( centerPt, lyr.Width div 2, lyr.Height div 2, 30 ); ```Nigel Xequte Softwarewww.imageen.com
Topic
 New Topic  Reply to Topic  Printer Friendly Jump To: Select Forum ImageEn Library for Delphi, C++ and .Net       ImageEn and IEvolution Support Forum  -------------------- Home Active Topics Frequently Asked Questions Member Information Search Page