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
 How to get actual size of visual bitmap

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
BionicWave Posted - Jul 27 2011 : 16:55:09
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.
1   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Jul 27 2011 : 22:39:08
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);