Board index » cppbuilder » TBimap and thread

TBimap and thread


2004-05-05 05:46:19 PM
cppbuilder75
I have a problem to create bitmaps in a thread. Sometimes when i want to
save my bitmap i have a EouOfResources exception and i don't know why. After
a few experimentations, it seems that when i do a FillRect on the canvas of
my bitmap, sometimes the savetofile function generate this exception. Has
anyone an idea why ?
 
 

Re:TBimap and thread

Hi,
Are you accessing the bitmap from multiple threads? In particular,
if you're drawing to the bitmap's Canvas from multiple threads, the
TCanvas class has Lock() and Unlock() methods, which provide
drawing-based synchronization. Does your code work when executed within
the context of the main thread?
Good luck,
Yoann chaigneau wrote:
Quote
I have a problem to create bitmaps in a thread. Sometimes when i want to
save my bitmap i have a EouOfResources exception and i don't know why. After
a few experimentations, it seems that when i do a FillRect on the canvas of
my bitmap, sometimes the savetofile function generate this exception. Has
anyone an idea why ?