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
 Flash when adding a layer when image having a navigator
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

esprd

10 Posts

Posted - Jul 08 2025 :  13:14:30  Show Profile  Reply
Hello,

I've got a TImageEnView where I have several layers.

Each time I add a layer, the image "blink" with the "default" new layer :
- adding a ielkImage, a "blank" layer is briefly displayed
- adding a ielkShape iesRectangle, a red ellipse (!) is briefly displayed

To make it simple, it is like there is and Image update withing ImageEnView1.LayersAdd.

This occurs only if I set a navigator for the image.
I tried to add the "ienoDontRefreshSrcIfNavNotFocused" option for SetNavigator, without success.

Is there a way to prevent this ?

I attach a small project repoducing the problem.

Regards,

attach/esprd/202578131341_Test layers - For forum.zip
2967.14 KB

ep

xequte

39097 Posts

Posted - Jul 08 2025 :  21:43:21  Show Profile  Reply
Hi

If you are using a Navigator it will need to update the image to display the view. To prevent this, wrap any "intermediate-state" code in LockUpdate/UnlockUpdate:

  ImageEnView1.LockUpdate();
  ImageEnView1.LayersAdd(iesRectangle,
                         ImageEnView1.Layers[0].PosX,
                         ImageEnView1.Layers[0].PosY,
                         ImageEnView1.Layers[0].Width,
                         ImageEnView1.Layers[0].Height);

  ImageEnView1.Layers[ImageEnView1.LayersCount-1].FillColor := clBlack;
  ImageEnView1.UnlockUpdate();


Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: