Argh! Where's my mouse? Ah look at the eyes .... there it is! ;)) Mouse Eyes is another mouse cursor follower. Mouse eyes idea is indicating which direction to look in to find your mouse cursor. A great idea for the Fancy Delphi Application Contest.
Mouse Eyes
Here's how to use Mouse Eyes- Starting the app will display the eyes at the centre of the screen.
- You can click-n-drag the eyes to move then.
- You can close the app by right-clicking and selecting Exit.
- The position of the eyes will be remembered the next time the app is run.
- Form Transparency
- StayOnTop Form
- User painting to Form canvas
- Smoothing painting via DoubleBuffered
- Form movement via from click-n-drag on the eyes
- Access to display info via Screen and Mouse objects
- Creative use of MulDiv.
- Requires Delphi 2007 to compile.
procedure TfrmMain.FormPaint(Sender: TObject) ;Of course, the "drawPupil" method is what's interesting. Download the full source code to explore. Or, just the EXE to have some fun!
const
LEFT_EYE : TRect = (Left:24; Top:8; Right:50; Bottom:38) ;
RIGHT_EYE : TRect = (Left:52; Top:8; Right:78; Bottom:38) ;
begin
// draw eyes
Canvas.Brush.Color := clWhite;
Canvas.Brush.Style := bsSolid;
Canvas.Pen.Color := clBlack;
Canvas.Pen.Style := psSolid;
Canvas.Pen.Width := 1;
Canvas.Ellipse(LEFT_EYE) ;
Canvas.Ellipse(RIGHT_EYE) ;
// draw pupils
Canvas.Brush.Color := clBlack;
Canvas.Brush.Style := bsSolid;
Canvas.Pen.Style := psClear;
// left Eye
drawPupil(LEFT_EYE) ;
// right Eye
drawPupil(RIGHT_EYE) ;
end;
"Mouse Eyes" was submitted by "Graeme Foot".
Do you have a FDA(C)? Submit your Delphi code to the Fancy Delphi Application Contest.


