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
 TImageEnIO / TImageEnProc reuse
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

HeartWare

Denmark
46 Posts

Posted - Mar 09 2022 :  01:51:23  Show Profile  Reply
I have trouble re-using a globally allocated TImageEnIO / TImageEnProc (no, not multi-threaded).

I want to use the same instance but operate on different TBitMap/TIEBitMap/TImageEn/TImage, so I assign the IO's AttachedBitmap etc. to the one I want to work on now.

But I run into access violations in TIEBitMap.FreeImage, which gets called with a NIL instance (Stack Trace: TImageEnIO.SetAttachedBitmap -> TIEBitmap.EncapsulateTBitmap -> TIEBitmap.FreeImage).

I have tried setting the various "AttachedXXX" properties to NIL (to "clear" it) before assigning the AttachedBitmap, but that doesn't work either (in some cases, I even get an error when I set one of these to NIL).

What is the proper procedure to use the same TImageEnIO for different use cases (different AttachedXXX)?

xequte

38191 Posts

Posted - Mar 09 2022 :  22:15:23  Show Profile  Reply
Hi

This is fixed in v10.3.5, next week.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

HeartWare

Denmark
46 Posts

Posted - Mar 23 2022 :  09:13:01  Show Profile  Reply
What is the proper procedure to re-use a TImageEnIO / TImageEnProc? Should I disable all the AttachedXXX before assigning the correct one, or is an implicit disable of all other AttachedXXX done within a new assignment to any AttachedXXX property?
Go to Top of Page

xequte

38191 Posts

Posted - Mar 23 2022 :  16:36:24  Show Profile  Reply
Hi

It should be enough just to assign a new object to AttachedXXX. If you see otherwise, let us know and we will test for that combination. There are some edge cases that may have an undocumented effect such as attaching a TIEBitmap after attaching a TBitmap.

Our recommendation would be not to reuse TImageEnIO or TImageEnProc at all. There would be negligible performance benefits to it. Just create them as needed.

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