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
 "Active layer does not contain bitmap"

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
xequte Posted - Sep 07 2020 : 01:35:16
You will get this error when trying to perform an image editing function (such as Proc.Rotate) when an image layer is not selected.

To prevent this, check the type of layer, e.g.

// Calculate number of colors in current image
procedure TMainForm.miCalccolornumberClick(Sender: TObject);
var
  nc: integer;
begin
  if ImageEnView1.CurrentLayer.Kind <> ielkImage then
    ShowMessage('An image layer is not selected')
  else
  begin
    nc := ImageEnView1.Proc.CalcImageNumColors;
    ShowMessage('The active images has ' + inttostr(nc) + ' colors.');
  end;
end;



Nigel
Xequte Software
www.imageen.com
2   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 08 2020 : 05:56:34
Yes, that is correct.

Nigel
Xequte Software
www.imageen.com
PeterPanino Posted - Sep 08 2020 : 05:35:26
Wouldn't this be a reliable solution:

var OldActiveLayer: Integer;
OldActiveLayer := ImageEnView1.LayersCurrent;
try
  // if you only want to get the number of colors in your TImageEnView image
  ImageEnView1.LayersCurrent := 0;
  nc := ImageEnView1.Proc.CalcImageNumColors;
finally
  ImageEnView1.LayersCurrent := OldActiveLayer;
end;