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
 load picture to existing layer keep layer size

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
ZS Tekatec Posted - Feb 18 2025 : 14:04:16
Hi,

I've an image layer with the caption "Load image".
Then I'd like to load an image into this area as you can see below.
If the loaded image is larger than the layer area, it should fit proportionally.
Do you have any tips?




ZS
4   L A T E S T    R E P L I E S    (Newest First)
ZS Tekatec Posted - Feb 28 2025 : 17:39:03
thank you, it works.


ZS
xequte Posted - Feb 23 2025 : 15:57:20
I see. For image layers, it tries to create at its native size, so you need to lock the image layer dimensions

// Load image so it fits within the current layer dimensions 
lyr := TIEImageLayer(ImageEnView1.CurrentLayer);
// Lock image layer size
lyr.Width  := lyr.Width;  
lyr.Height := lyr.Height;
ImageEnView1.IO.LoadFromFile( 'D:\image.jpg' );
lyr.RestoreAspectRatio();


Nigel
Xequte Software
www.imageen.com
ZS Tekatec Posted - Feb 20 2025 : 16:33:42
Yes, I'm able to reproduce it in your demo.
The problem occurs when ImageEnView1.LayersMerge([idx1, idx2]) is used and I try to load an image into the merged layer.

1) I create a text layer with the heading "Load image"

ImageEnView1.LayersAdd(ielkText); // add a new textlayer
  lyr := TIETextLayer(ImageEnView1.CurrentLayer);
  lyr.Text := 'Load image';
  lyr.Name := 'T1';
  lyr.Font.Size := 28;
  lyr.PosX := TIEImageLayer(ImageEnView1.Layers[1]).PosX;
  lyr.PosY := TIEImageLayer(ImageEnView1.Layers[1]).PosY;
  lyr.Height := TIEImageLayer(ImageEnView1.Layers[1]).Height + 1;
  lyr.Width := TIEImageLayer(ImageEnView1.Layers[1]).Width + 1;
  lyr.FillColor := clWhite;
  lyr.BorderWidth := 4;
  lyr.BorderColor := clBlack;
  lyr.Alignment := iejCenter;
  lyr.Layout := ielCenter;



2) I merge the image (index = 1) with the text layer
ImageEnView1.LayersMerge([1, lyr.LayerIndex]);

3) I try to load new image into the merged layer from point 2 - and then the loaded image doesn't fit into the merged layer, it has original size.

ZS
xequte Posted - Feb 18 2025 : 14:22:20
Hi

It should always being make an image fit within the layer rectangle proportionally after loading. I just tested this with v13.7.0.

Are you able to reproduce in one of our demos? If so, please give me the steps.

Note: You can also modify the properties of the selected layer after an action by using:

http://www.imageen.com/help/TIEView.OnActionExecute.html



Nigel
Xequte Software
www.imageen.com