Fsdn
Fsdn

Reputation: 155

Most efficient way to draw on the top of the Screen (Overlay layer). in .Net?

I want to draw elements and move them on the top of the screen whatever the user is doing.

If I go in C# with Windows Forms I have 2 solutions :

  1. Create a transparent-background Form and Draw on it,

    • override the OnPaint event
    • invalidate every X ms
  2. Create a transparent-background Form for each element created (Rectangle, Circle, etc.).

    • just move the forms and do not force redraw

Do form gestion is a way more costful or the Paint refresh is ?

Do I have to go with WPF, Silverlight, C or Windows Form is fine ?

Upvotes: 1

Views: 1331

Answers (1)

Woodman
Woodman

Reputation: 1137

I can suggest how it could be implemented in WPF - there you can make use Transform property available in many UI-related classes and TranslateTransform class to move these objects in efficient way.

But it really depends on how many moving objects you are planning to have in window simultaneously. In certain cases it could be more efficient to switch to some specific game-oriented solutions like XNA and similar.

Upvotes: 0

Related Questions