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
 Layer Editor - Fixed Page 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
corundum Posted - Aug 27 2021 : 13:33:16
I'm not sure that this is specific to layers, but I'd like to be able to set the size of a drawing area (e.g, background layer???) to a standard paper size (say, US 8.5 x 11 inches) and keep the page fixed at that size (no expansion if a layer is moved outside the page size, for example). How would this be accomplished?
7   L A T E S T    R E P L I E S    (Newest First)
corundum Posted - Sep 09 2021 : 20:06:23
Just getting back to this now. It's now working as expected. Thank you!
aleatprog Posted - Sep 02 2021 : 03:43:46
Hi Greg,

once you see the size information in layer[0] (in Nigel's example: 500 x 500) your problem is solved as ImageEnView1.LayersCropped := True uses these values.

You also may use IELayerMView1.Update in order to see the updated situation in the attached ImageEnLayerMView.

ImageEnView1.IEBitmap.Allocate(500, 500, clWhite);
ImageEnView1.Update;
ImageEnLayerMView1.Update;

Al
xequte Posted - Sep 01 2021 : 17:29:52
Hi Greg

The demo calls ImageEnView1.Blank() in FormShow. So you need to set the bitmap size after that.

You can ensure you have a valid background by checking the size where it says "Background" in the LayerMView on the left.

If no size is shown then it is blank.




Here's an example where the background is transparent:



Nigel
Xequte Software
www.imageen.com
corundum Posted - Aug 31 2021 : 13:31:43
Nigel:

I'm still getting the same result. The FormCreate code I'm using is below. The only code I added to the demo are the first three lines of this method.

Greg

procedure Tfmain.FormCreate(Sender: TObject);
begin  
  ImageEnView1.IEBitmap.Allocate(500, 500, clWhite);
  ImageEnView1.Update();
  ImageEnView1.LayersCropped := True;

  fUpdating := True;
  IEInitializeComboBox(cmbShape);

  // Enable dragging of thumbnails to rearrange layers and remove layers
  IELayerMView1.LayerOptions := IELayerMView1.LayerOptions +
    [lvDragOrdering, lvDragDelete];

  // Show layer descriptions on hover
  IELayerMView1.ShowThumbnailHint := True;

  IELayerMView1.ReadOnly := False;

  ImageEnView1.Proc.UndoLimit := 30;
  ImageEnView1.LayerOptions := ImageEnView1.LayerOptions +
    [loAutoUndoChangesByuser, loAutoUndoChangesByCode];
end;
xequte Posted - Aug 30 2021 : 18:35:45
Hi

Yes, because they are outside your background layer (which appears to empty). If you want them to paint you need to create a background layer, e.g.

  ImageEnView1.IEBitmap.Allocate(500, 500, clWhite);
  ImageEnView1.Update();


If you don't want it visible, set Alpha to 0.

  ImageEnView1.IEBitmap.Allocate(500, 500, clWhite, 0);
  ImageEnView1.Update();


Nigel
Xequte Software
www.imageen.com
corundum Posted - Aug 30 2021 : 10:15:02
Nigel:

When I set LayersCropped to True, I am able add draw shapes, but they don't draw. This can be replicated by adding the following line as the first line in FormCreate in the Layers_AllTypes demo:

ImageEnView1.LayersCropped := True;


A screenshot is attached.

Greg


xequte Posted - Aug 27 2021 : 20:10:16
Hi

You can set the background image (layer[0]) to the desired size and then:

1. Enable loPreventOutOfBounds in LayerOptions:

https://www.imageen.com/help/TImageEnView.LayerOptions.html


2. Crop any layers moved outside the background layer:

https://www.imageen.com/help/TImageEnView.LayersCropped.html


3. Adjust layer bounds as the user moves the layer:

https://www.imageen.com/help/TImageEnView.OnLayerMoveSize.html



Nigel
Xequte Software
www.imageen.com