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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 How to get actual size of visual bitmap
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

BionicWave

Germany
33 Posts

Posted - Jul 27 2011 :  16:55:09  Show Profile  Reply
Lets say you have a TImageEn Component, load it with a picture.
Lets Zoom in, so that you cannot see the whole picture.
How do i get to know the actual size of the bitmap in its zoomed state?
The original size of the picture is 256x256 pixels. In Zoomed state it is much bigger. I need to know the exact size in zoomed mode.

fab

1310 Posts

Posted - Jul 27 2011 :  22:39:08  Show Profile  Reply
It is difficult to know the exact size due math rounding problems.
This formula can only estimate the exact size:

width := trunc(ImageEn.IEBitmap.Width * ImageEn.Zoom / 100);
height := trunc(ImageEn.IEBitmap.Height * ImageEn.Zoom / 100);

While the exact size is (which can change of 0..1 from the estimated one):

width :=ImageEn.XBmp2Scr(ImageEn.IEBitmap.Width) - ImageEn.XBmp2Scr(0);
height := ImageEn.YBmp2Scr(ImageEn.IEBitmap.Height) - ImageEn.YBmp2Scr(0);
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: