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
 Drawing Units: BaseLayer=Bitmap; LayerN=PolylineLayer - Layer Units

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
andyhill Posted - Feb 18 2025 : 17:25:40
My PC has a display of 144dpi per inch.

millimeter:= 1 * (Screen.PixelsPerInch * 25.4); // 57px per mm

BaseLayer is overlayed with PolyLine Layers

eg.
ImageEnView.LayersAdd(ielkPolyline);
with TIEPolylineLayer(ImageEnView.CurrentLayer) do begin
AddPoint(FrmTblRec.Left, FrmTblRec.Top, iepbBitmap); // 1, 1, 3779, 3779
AddPoint(FrmTblRec.Right, FrmTblRec.Top, iepbBitmap);
AddPoint(FrmTblRec.Right, FrmTblRec.Bottom, iepbBitmap);
AddPoint(FrmTblRec.Left, FrmTblRec.Bottom, iepbBitmap);
PolylineClosed:= True;

I want to draw on LayerN (points in millimeters)

Later I want to read from LayerN (PosX and PosY in millimeters)

I understand a scale needs to be set based against the BaseLayer, at present 3779px = 1mtr approx

Having a seniors moment, can we not just set drawing units per layer ?

Andy
1   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Feb 18 2025 : 22:36:07
Hi Andy

There is a helper method to perform these kinds of conversions:

http://www.imageen.com/help/IEConvertToUnits.html

e.g.

// Convert 4 inches to pixels at the current DPI of the image
in := IEConvertToUnits( 4, ieuInches, ieuPixels, ImageEnView1.IO.Params.DPI );


Nigel
Xequte Software
www.imageen.com