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
 Change units of measure

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
rico Posted - Jul 18 2013 : 10:48:24
Property "AcquireParams.PhysicalWidth" returns the data in inches. How to switch the units to millimeters?
1   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Jul 18 2013 : 13:36:59
There is not a method to do this. You have to do it yourself:
var
  i: integer;
  iPhysicalWidthINCH: double;
  iPhysicalHeightINCH: double;
  iPhysicalWidthMM: double;
  iPhysicalHeightMM: double;
  iPhysicalWidthPixels: integer;
  iPhysicalHeightPixels: integer;
  iString: string;
begin
  iPhysicalWidthINCH := ImageEnView1.IO.AcquireParams.PhysicalWidth;
  PhysicalWidthINCH1.Caption := 'Physical Width (Inch): ' +
    FormatFloat('##.##', iPhysicalWidthINCH);

  iPhysicalHeightINCH :=
      ImageEnView1.IO.AcquireParams.PhysicalHeight;
  PhysicalHeightINCH1.Caption := 'Physical Height (Inch): ' +
    FormatFloat('##.##', iPhysicalHeightINCH);

  iPhysicalWidthMM := ImageEnView1.IO.AcquireParams.PhysicalWidth * 25.4;
  PhysicalWidthMM1.Caption := 'Physical Width (mm): ' + FormatFloat
    ('####', (iPhysicalWidthMM));

  iPhysicalHeightMM := ImageEnView1.IO.AcquireParams.PhysicalHeight * 25.4;
  PhysicalHeightMM1.Caption := 'Physical Height (mm): ' + FormatFloat('####', iPhysicalHeightMM);

  iPhysicalWidthPixels := ImageEnView1.IO.AcquireParams.PhysicalWidthPixels;
  { Add commas to string }
  iString := IntToStr(iPhysicalWidthPixels);
  i := Length(iString) - 2;
  while i > 1 do
  begin
    Insert(SysUtils.ThousandSeparator, iString, i);
    i := i - 3;
  end;

  PhysicalWidthPixels1.Caption := 'Physical Width (pixels): ' + iString;
  { Add commas to string }
  iPhysicalHeightPixels := ImageEnView1.IO.AcquireParams.PhysicalHeightPixels;
  iString := IntToStr(iPhysicalHeightPixels);
  i := Length(iString) - 2;
  while i > 1 do
  begin
    Insert(SysUtils.ThousandSeparator, iString, i);
    i := i - 3;
  end;
  PhysicalHeightPixels1.Caption := 'Physical Height (pixels): ' + iString;
end;

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