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
 Adding a Layer Causes TImageEnView to report empty

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
Elemental Posted - Nov 25 2020 : 16:20:53
I have noticed the following odd behavior with ImageEn for Delphi, version 7.2.6:

Load an image into ImageEnView1 with LoadFromFile which is bigger than 2 x 2
ImageEnView1.IsEmpty returns False
Call ImageEnView1.LayersAdd()
ImageEnView1.IsEmpty now returns True.

The image is clearly not empty nor too small. I believe the problem is that IsEmpty relies on fIEBitmapValid, and that flag is being re-set to False in SetLayersCurrentEx because the new layer (a shape) is not a valid bitmap. I have attached a small sample project which was made in Delphi XE7, but the bug is still manifest in Sydney.

"Roj"

attach/Elemental/2020112516207_ImageEnIsEmpty.zip
57.83 KB
3   L A T E S T    R E P L I E S    (Newest First)
Elemental Posted - Nov 30 2020 : 13:32:27
Thank you for your response. Since the tool in question should only be active when an image is actually loaded, I set a private boolean to the result of LoadFromFile, and then check that boolean in the OnUpdate method of the action. After all, I didn't want an OnUpdate method to change the active layer, and there is always a layer 0 so I couldn't check against that. Thanks, Nigel.
xequte Posted - Nov 27 2020 : 13:34:52
Hi Roj

That is correct. IsEmpty returns the status of the active layer.

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

When you can LayersAdd() the new layer will be empty, so the result is true.



Nigel
Xequte Software
www.imageen.com
Elemental Posted - Nov 25 2020 : 16:24:44
I'm sorry. It's version 9.2.6, not 7.2.6.