Home > Back-end >  Delphi analog clock animation effects, take up much of my cup, urgent urgent
Delphi analog clock animation effects, take up much of my cup, urgent urgent

Time:10-30

 
Procedure TForm1. FormPaint (Sender: TObject);
Var
G: TGPGraphics;
The begin
G:=TGPGraphics. Create (Canvas. Handle). G.D rawImage (img3, MakeRect (rt3));
G.F ree;
end;
Procedure TForm1. Timer3Timer (Sender: TObject);
The begin
Nl:=(nl 360) mod + 10;
Img3. Free;
Img3:=TGPImage. Create (' new folder \ '+ inttostr (nl) +' PNG ');
Repaint;
Inc (ll);
Nl:=(nl + 10) mod 360;
If ll>=200, then begin
Timer3. Enabled:=false;
Ll:=0;
end;
end;

PNG images is each had a total of 360
Accelerate the rotation effect, use this code to simulate second found CPU is too high, consult everybody has to have good implementation method

CodePudding user response:

If you just for the sake of speed, you can put the pictures loaded into memory, change regularly

CodePudding user response:

360 zhang? The first time I saw this method,,,
The somebody else all rotate the image map

CodePudding user response:

If LZ insist on using the multiple switching scheme, to optimize the CPU, suggested that "in space, in time," starts a one-time all images are loaded into memory, rather than in figure every time to read the file (disk I/O performance overhead is too big), specific practices can create 360 a TGPGraphics object loaded into all of my pictures, when switching checkmark load line,

CodePudding user response:

But less so pit dad approach should be: clock background with a picture, a pointer is dynamic drawing up, or do a pointer image rotation transform again after the poster,

CodePudding user response:

reference 4 floor response:
but less so pit dad approach should be: clock background with a picture, pointer, dynamic paintings, or do a pointer image rotation transform again after the poster,

Originally tried an image rotation changes but find image in jitter

CodePudding user response:

Please leave your email, give you an example,

CodePudding user response:

The
reference 6th floor response:
please leave your email, give you an example, the


229280067 @qq.com thanks

CodePudding user response:

The code has been sent to your mailbox, please check,

CodePudding user response:

The
references to the eighth floor response:
code has been sent to your mailbox, please find,

Every 40 milliseconds will consist of a frame or CPU

CodePudding user response:

Read the file "inside", accounted for 3% of the CPU is not super don't know how much you require is not "of CPU"

CodePudding user response:

With Canvas painting, his pointer position calculation

CodePudding user response:

references 9 floor response:
move every 40 milliseconds will consist of a frame or CPU

Ha ha, it seems LZ want to look at the ExitWindowsEx (EWX_SHUTDOWN, 0), so as not to occupy your CPU,

CodePudding user response:

To turn it off? JPEXE you crazy,,

CodePudding user response:

You use Canvas painting needle,

CodePudding user response:

To download a Raize there is a clock control panel controls
  • Related