Tuesday, April 9, 2013

Draw to TBitmap fail !

[Reference] http://qc.embarcadero.com/wc/qcmain.aspx?d=43018


At multi-thread program. The canvas handle of the Bitmap may be freed during the drawing procedure. So, lock the canvas before the drawing operation. And free after the drawing.
Lock the canvas may reduce the performance. But sometimes you have to do this.

Canvas->Lock();

drawing....

Canvas0->Unlock();

No comments:

Post a Comment

[Qt] 執行檔需要哪些 Dll?

 1. 使用 Qt  的 windeployqt.exe 工具 (在 C:\Qt\Qt5.14.1\5.14.1\msvc2017\bin\)。   a. 把執行檔 myProgram.exe 放在某個資料夾。   b. 在檔案總管這個資料夾按 Shift 和滑鼠右鍵,開啟 Po...