We can often see many lively and interesting animated mouse, in fact use Delphi powerful, we can have a personal whim production characteristics of the mouse. I produced a mouse named face of animation in the normal, it is a round face, the face of a pair of big eyes Gulululuanzhuai eyes. When pressed left (right) button, face the left (right) eye on what Zha. If sustained hold left (right) eye Zha incessantly. Now I use this as an example animated mouse, outlining how to make animated mouse.
First, in Delphi under the main menu tool election image editor, edit a document entitled face.res resources, which should include the production of the five individuals. Cur documents: faceleft.cur (are: a pair of round face on the left see the eyes), faceright.cur (are: a round face, the right to see a pair of eyes), plainface.cur (are: a round face, a pair of forward-looking eyes), leftshrink.cur (are: Bizhao His left eye was the round face), rightshrink.cur (are: Bizhao right eye of the round face).
Good resources documents, open a new window and placing PopupMenu FORM1 components, the properties of the FORM1 for PopupMenu1 PopupMenu home. Then in the INTERFACE UNIT1 under paragraph by adding the following code:
($ R face.res)
TForm1.FormCreate incident, and by adding the following code:
Screen.cursors [1]: = LoadCursor (hInstance,
PChar ( 'lfaceleft'));
Screen.cursors [2]: = LoadCursor (hInstance,
PChar ( 'faceright'));
Screen.cursors [3]: = LoadCursor (hInstance,
PChar ( 'plainface'));
Screen.cursors [4]: = LoadCursor (hInstance,
PChar ( 'leftshrink'));
Screen.cursors [5]: = LoadCursor (hInstance,
PChar ( 'rightshrink'));
Screen.cursor: = plainface;
TForm1.FormClick incident included in the code below:
Screen.cursor: = faceleft;
Screen.cursor: = plainface;
TForm1.FormKeyDown incident included in the code below:
MbLeft then if button =
Begin
Screen.cursor: = leftshrink;
Screen.cursor: = plainface;
End;
MbRight then if button =
Begin
Screen.cursor: = rightshrink;
Screen.cursor: = plainface;
End;
……
The remaining details, the reader added. Done everything, run it, generating exe file, OK! An interesting animation mouse completed, you can run it to see a lively sense of humor has a round face. Of course, you can also according to your preferences and arbitrary imagination to design other interesting animation mouse. |