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
 Minimum size of layer

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
markus42 Posted - Jan 22 2013 : 07:15:40
Hi,
one other problem.
In my application the user can rotate and resize some layers.
After the work is finnished i have to save every layer as jpg file.

Before i "export" the layers i set fixrotations, fixborders and fixsize for every layer (because i need the rotation) for export too.

if the user creates a small layer with the mouse, the exported jpg is very small (like the layer). So i search a solution how can i set a minimum size for the layers (for example in a event).

Thanks a lot.

Kind Regards

Markus
3   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Jan 23 2013 : 06:52:30
procedure TForm1.ImageEnView1LayerNotify(Sender: 
TObject; layer: Integer;
  event: TIELayerEvent);
begin
  if event = ielResizing then
  begin
    if ImageEnView1.Layers[layer].Width < StrToInt(MinimumLayerWidth1.Text) then
    begin
      ShowMessage('The minumum layer width is ' + MinimumLayerWidth1.Text + '.');
      ImageEnView1.Layers[layer].Width := StrToInt(MinimumLayerWidth1.Text);
      ImageEnView1.Update;
    end;
    if ImageEnView1.Layers[layer].Height < StrToInt(MinimumLayerHeight1.Text) then
    begin
      ShowMessage('The minumum layer height is ' + MinimumLayerHeight1.Text + '.');
      ImageEnView1.Layers[layer].Height := StrToInt(MinimumLayerHeight1.Text);
      ImageEnView1.Update;
    end;
  end;
end;

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
markus42 Posted - Jan 23 2013 : 00:41:37
This looks what i want, thank you so much.
What is the best way to stop the resize feature, if a minimum is reached.

Thanks again

Markus
w2m Posted - Jan 22 2013 : 07:58:20
You can set the minimum layer dimensions in the ImageEnView1LayerNotify event:
procedure TForm1.ImageEnView1LayerNotify(Sender: 
TObject; layer: Integer;
  event: TIELayerEvent);
begin
  if event = ielResized then
  begin
    if ImageEnView1.Layers[layer].Width < StrToInt(MinimumLayerWidth1.Text) then
    begin
      ShowMessage('The minumum layer width is ' + MinimumLayerWidth1.Text + '.');
      ImageEnView1.Layers[layer].Width := StrToInt(MinimumLayerWidth1.Text);
      ImageEnView1.Update;
    end;
    if ImageEnView1.Layers[layer].Height < StrToInt(MinimumLayerHeight1.Text) then
    begin
      ShowMessage('The minumum layer height is ' + MinimumLayerHeight1.Text + '.');
      ImageEnView1.Layers[layer].Height := StrToInt(MinimumLayerHeight1.Text);
      ImageEnView1.Update;
    end;
  end;
end;

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html