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
 ImageenDBview confuses me
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

pierrotsc

USA
500 Posts

Posted - May 03 2026 :  16:31:01  Show Profile  Reply
I think I am getting too old.
I have an imageenDBview component That is hiding in a pagecontrol tab. Its name is StepTablet_View
I use nexusDB database and i have a 21 step tablet grayscale.
When i export the step tablet from the database, I have a dimension of 440x20.
I have the datafield as ifJpeg or ifBitmap. tried both
I have legacybitmap true. should I ?
Selection base is iesbBitmap but not sure if i should pick iesbClientarea.
I have the width of steptablet_View as 440 and height as 20 to match I assume the image in the database

Now this is the code I have to see what is going on because it looks like i am not getting the right size whatever i try.

Steptablet_View.loadpicture();
Steptablet_View.fit;
//Steptablet_View.Proc.Resample(440, 20, rfNone, True);
showmessage(inttostr(Steptablet_view.iebitmap.width)+' '+inttostr(Steptablet_View.iebitmap.Height)); Gives me 440x48
showmessage(inttostr(Steptablet_view.width)+' '+inttostr(Steptablet_View.Height)); Gives me 660x30

Resampling does not change the values I am getting above.
How can i get my Stetablet_View to be 440x20 with the image inside that fits perfectly?

thanks
Pierre

xequte

39411 Posts

Posted - May 03 2026 :  18:18:07  Show Profile  Reply
Hi Pierre

It sounds like the size of the image in your database is actually 440x48, and your control is 660x30, so neither of these will give you 440x20.

If you make your control 440x20 + the size of the border area (= ImageEnView1.Client - ImageEnView1.ClientWidth), then use:

// Stretch image to control size without maintaining the aspect ratio
ImageEnView1.GetIdealZoom( zoomX, zoomY );
ImageEnView1.ZoomX := zoomX;
ImageEnView1.ZoomY := zoomY;

Note: Because the image is not the same ratio as the control, we need to do an asymmetrical zoom to fill the control completely.

See: https://www.imageen.com/help/TImageEnView.GetIdealZoom.html


Also see:
https://www.imageen.com/help/TImageEnView.IdealComponentWidth.html
https://www.imageen.com/help/TImageEnView.IdealComponentHeight.html

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: