Home > Back-end >  Why BeginThread create threads in the drawing code doesn't work?
Why BeginThread create threads in the drawing code doesn't work?

Time:10-05

As title, BeginThread creates a thread, the thread of MovtoEx, showed no effect, Lineto drawing code, if the code to remove thread calls is no problem,

CodePudding user response:

Involves the VCL update, should use thread that the Synchronize

CodePudding user response:

No code of textual fault description is meaningless,

CodePudding user response:

Is Canvase.
Roughly as follows:
Void StartGifPlay (HDC HDC, WORD x, WORD y, STR TMemoryStream * and bool bStream)//play GIF animation
{
Cs. Hdc=Hdc;////Hdc to form a frmShow - & gt; Img - & gt; Canvas - & gt; Handle;
ShowImg BeginThread (0, 0, (TThreadFunc), (LPVOID) (& amp; Cs), 0, 0);//open the new process to play the GIF
}
Long __fastcall ShowImg (LPVOID pParam)
{
Cs * PCS=* (Cs) pParam;
HDC dc PCS - & gt; Hdc.
MovetoEx (dc, 0, 0);
Lineto (dc, 100100); <===this two drawing code is invalid, interface effect see
return 0;
}
=========
If the drawing code are placed outside the thread is no problem,
  • Related