Board index » cppbuilder » Problem transferring TBitmap to Canvas

Problem transferring TBitmap to Canvas

Hi,

I'm trying to display a sound waveform on a TImage control. The sound is
being captured by MME calls in a separate thread.
I've got a TBitmap onto which I draw the waveform, and then use
Image->Canvas->Draw(...) to transfer it across.

It works fine on the whole, but if I move the mouse, the display freezes.
The redraw code is still being called - it's just the
Image->Canvas->Draw(...) call fails. Access to the both the bitmap and image
canvases are protected by Lock / Unlock calls, so I don't think it's a
multi-thread issue.

Does anyone have any suggestions either a) what is wrong or b) what I could
possibly do to a TBitmap to make it not Draw(...) onto a Canvas.

Thanks in advance,

Dave.

 

Re:Problem transferring TBitmap to Canvas


Hi,

I'm trying to display a sound waveform on a TImage control. The sound is
being captured by MME calls in a separate thread.
I've got a TBitmap onto which I draw the waveform, and then use
Image->Canvas->Draw(...) to transfer it across.

It works fine on the whole, but if I move the mouse, the display freezes
after a while. The redraw code is still being called - it's just the
Image->Canvas->Draw(...) call fails. Access to the both the bitmap and image
canvases are protected by Lock / Unlock calls, so I don't think it's a
multi-thread issue.

Does anyone have any suggestions either a) what is wrong or b) what I could
possibly do to a TBitmap to make it not Draw(...) onto a Canvas.

Thanks in advance,

Dave.

Other Threads