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
 Calculating the size of the *image* in a TImageEnMView thumbnail

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
HeartWare Posted - Nov 17 2021 : 02:37:00

If I have a TImageEnMView with 100x100 thumbnail and a BottomText, how do I calculate the *actual* size of the *image* within the thumbnail (in my measurements, it's 66x66 pixels, but how is this *calculated*?).

I'm resizing my images to the thumbnail size, but ImageEn then resizes (shrinks) it even further. How can I ensure that my image (TiEBitmap) is resized - by me - to the proper size, and not resized further by ImageEn?

If I resize it to 66x66 will ImageEn then first enlarge it to 100x100 and then reduce it to 66x66 afterwards, or will it use the image at 66x66 directly?

Keld R. Hansen
7   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Nov 24 2021 : 14:51:26
Hi

It is a parameter "CheckSoftShadow" that is off by default so as not to break any existing user functionality.

Nigel
Xequte Software
www.imageen.com
HeartWare Posted - Nov 24 2021 : 04:35:18
When you update ThumbSizeInfo make sure to include the fix in a new method (ie. a new enumeration value), instead of fixing the itsImage calculation (otherwise my updated code will suddenly adjust for the soft shadow twice and yield incorrect results).
HeartWare Posted - Nov 24 2021 : 02:34:16
While creating the demo program, I found out that it was the Soft Shadow that interfered. When I take that into account, it returns the correct value. All of that because I did as recommended and called "SetModernStyling" and that screwed it up :-).

In case anyone is interested, the Demo program (incl. a toggle to enable/disable Modern Styling) can be downloaded here:
https://www.dropbox.com/s/h1mmjdqa7gu2qyc/Demo.zip?dl=1

In all cases, it's the 3rd image generated that works, regardless of other settings.
xequte Posted - Nov 23 2021 : 20:44:16
Hi

Regarding the invalid result for itsImage, you might have some legacy values for your TImageEnMView properties. Are you able to generate a small demo that shows it?

You look to be using a soft shadow, which ThumbSizeInfo() does not consider. I will add that as an option in the current beta. You can get the same result by deducting the following from the Result.X and .Y:

SoftShadowSize := IESoftShadowSize( ImageEnMView1.SoftShadow.Radius, ImageEnMView1.SoftShadow.OffsetX, ImageEnMView1.SoftShadow.OffsetY);

Also consider that ThumbSizeInfo() returns the maximum image width and height. One of the values will actually be lower because the image aspect ratio is maintained.

Also see:

https://www.imageen.com/help/TImageEnMView.SetThumbnailSize.html


Nigel
Xequte Software
www.imageen.com
HeartWare Posted - Nov 23 2021 : 02:07:07
Also, if I on a 100x100 Thumbnail size TImageEnMView generate a full red box of 100x100 and add it to the viewer with a text below, I get this:



The red square is exactly 66x66 pixels in size.

When I interrogate the ThumbSizeInfo, I get this:

100x78

So where does the other 12 pixels come from?

If I then use this information and generate a perfect checkered .BMP file of black and white pixels and add it, I get this image:



which clearly isn't a perfect checkered B&W image.

However, if I generate a 66x66 one, I get this:



which is clearly a perfect checkered B&W image.

So the ThumbSizeInfo is returning incorrect (or at least - in my case - unusable) information.

How do I get the *exact* size of the image portion of the cell, so I can render a file that isn't being resized by ImageEn before being displayed?
HeartWare Posted - Nov 23 2021 : 01:40:38
There's something I don't understand about this...

On a TImageEnMView with ThumbWidth=100 and ThumbHeight=100, I get these results:

itsCell returns 100x100
itsImage returns 100x113

How can the Image Size be larger than the Cell Size, when Cell Size *includes* Image Size and something more...

Value Description
itsImage Returns the size of the thumbnail image as displayed
itsCell Returns the size of the thumbnail cell (image, text and cell border)
xequte Posted - Nov 23 2021 : 00:19:45
Hi Keld

There are a number of factors that affect the true display size of the thumbnail, but you can get the size using:

https://www.imageen.com/help/TImageEnMView.ThumbSizeInfo.html

Nigel
Xequte Software
www.imageen.com