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
 Minimum size of layer
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

markus42

Germany
16 Posts

Posted - Jan 22 2013 :  07:15:40  Show Profile  Reply
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

w2m

USA
1990 Posts

Posted - Jan 22 2013 :  07:58:20  Show Profile  Reply
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
Go to Top of Page

markus42

Germany
16 Posts

Posted - Jan 23 2013 :  00:41:37  Show Profile  Reply
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
Go to Top of Page

w2m

USA
1990 Posts

Posted - Jan 23 2013 :  06:52:30  Show Profile  Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: