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
 Want to show only one bounding box...

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
yogiyang Posted - Aug 23 2018 : 00:12:51
Hello,

When a user selected multiple layers each layer show a bounding box.
Instead of this I want to show only one bounding box around all selected layers.

Is there any option by which we can tell IE to show a single bounding around selected layers?

How can we do this?

TIA


Yogi Yang
2   L A T E S T    R E P L I E S    (Newest First)
yogiyang Posted - Aug 23 2018 : 01:21:04
Hello Nigel,

Thanks. I will try out your code.

TIA


Yogi Yang
xequte Posted - Aug 23 2018 : 00:45:54
Hi Yogi


// Draw a box around all selected layers
// Note: To prevent the default selection box being drawn, create an empty OnDrawLayerBox event
procedure Tfmain.ImageEnView1DrawBackBuffer(Sender: TObject);
var
  cab: TRect;
  i, minX, minY, maxX, maxY : Integer;
begin
  minX := MAXINT;
  minY := MAXINT;
  maxX := 0;
  maxY := 0;

  for I := 0 to ImageEnView1.LayersCount - 1 do
    if ImageEnView1.Layers[ i ].Selected then
    begin
      cab := ImageEnView1.Layers[i].ClientAreaBox;
      minX := imin( minX, cab.Left );
      minY := imin( minY, cab.Top );
      maxX := imax( maxX, cab.Right );
      maxY := imax( maxY, cab.Bottom );
    end;

  // a green line
  if minX < MAXINT then
    with ImageEnView1.BackBuffer.Canvas do
    begin
      Pen.Style := psSolid;
      Pen.Width := 2;
      Pen.mode := pmCopy;
      Pen.Color := clGreen;
      Brush.Style := bsClear;
      Rectangle( minX - 1, minY - 1, maxX + 1, maxY + 1 );
    end;
end;


Nigel
Xequte Software
www.imageen.com