wpf - Performance of a semi transparent Window over multiple screens when moving a rectangle in realtime -
i've small app show semi transparent window on whole desktop. window isn't shown in taskbar , has not titlebar
on window user can drag rectangle mouse. when mouse button released, screenshot of given area taken. (something snipping tool in windows 7)
in order achieve this, window contains rectanglegeometry.
now in compositiontarget.rendering event rectangle set location mouse when mouse down occured, sized cover area current mouse position.
this works fine long 1 monitor connected. when second monitor higher resolution connected performance decreases dramatically.
the resolution of laptop display 1600x1200
the display connected has 1900x1200
also when connecting display changed primary screen new one
heres window definition
<window x:class="mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525" allowstransparency="true" background="transparent" windowstyle="none" > geometry definition <path fill="black" opacity="0.4" stroke="red" strokethickness="3"> <path.data> <rectanglegeometry x:name="inner" rect="105,5,90,90"/> </path.data> </path>
here portion of code moves rectangle
system.windows.rect location = new system.windows.rect(this.dragstart.x, this.dragstart.y, width, height);
this.inner.rect = rect;
does have idea on how improve performance ? "normal" performance decreases on higher resolutions multiple displays ?
first off, i'm not sure compositiontarget.rendering right tool job - might causing more damage - try using simple rectange within canvas...
we commonly have main application window spanning 3-4 1920x1200 screens. there noticable (but tolerable) performance drop when using multiple screens compared 1 screen.
we found using win xp span mode or win7 nvidia mosaic mode helped reduce performance drop (we have full control on runtime environment).
note had disable allowstransparency main window - when option enabled performance drop not tolerable!
also try forcing software rendering - might suprise (and in experience way ensure stable , artifact free multiscreen wpf environment in win xp, combined nvidia quadro graphic card).
Comments
Post a Comment