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
 ImageEn bitmap multi-thread

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
Chopinke Posted - Oct 30 2014 : 21:48:55
Hi,

I have a multi-threaded application where in the thread class I use regular VCL.Grapics.TBitmap:

1) Load BMP
2) Load a smaller BMP
3) Draw or StretchDraw the smaller BMP onto the larger BMP.

Now it seems when there are actually more threads are running the StretchDraw doesn’t do its task, it has to do with the GDI kernel call, maybe that’s not thread-safe. I tried Canvas.Lock but the results are still not satisfying.

My question is that the IEBitmap:
- Is it thread-safe?
- Does it is Windows GDI+?
- Does it have its own in-memory properties, like Canvas with Draw, StretchDraw and TextOut?
- I also still need the scaline property, is it available?

Thanks,

Chopin
2   L A T E S T    R E P L I E S    (Newest First)
nwscomps Posted - Nov 03 2014 : 07:05:07
My answer may not be complete or completely accurate. Xequite should be able to give you more exact information.

TIEBitmap should be thread safe according to my experience, when it does not use the GDI internally. I perform all kind of operations with TIEBitmap in multiple threads, with no problem.

TIEBitmap does have the scanline property to access the pixels at low level
As for the canvas property and the related methods, unless it was changed recently, it still relies on a TBitmap encapsulation.

But you should be easily able to replace canvas.draw and stretchdraw with the equivalent native methods of TIEBitmap

Francesco Savastano
Nwscomps.com
Add-ons for the ImageEn Library
Chopinke Posted - Oct 30 2014 : 23:03:13
I checked TIEBitmap.DrawToTIEBitmap, it would be good for my task to draw a smaller bitmap onto the larger bitmap. Is this thread-safe? Is this the TIE implementation and not the original Canvas implementation?

By trhead-safe I mean that both smaller and larger bitmaps are created inside the thread, but in regular TBitmap there are problems with Canvas.StretchDraw, sometimes it simply does nothing.

Thanks,

Chopin