Does Direct2D have CompositingModeCopy like GDI+? - direct2d

I am trying to move my virtual white board application from gdi+ to direct2d.
Perviously I used Graphics::SetCompositingMode(CompositingModeCopy) to "eraser" function, but I can't find similary interface in direct2d.
Thanks.

D2D1_COMPOSITING_MODE_SOURCE_COPY, which requires Direct2D 1.1 (Windows 8+, or Windows 7 SP1 w/ Platform Update)
https://msdn.microsoft.com/en-us/library/windows/desktop/hh446995(v=vs.85).aspx
Also, pairing ID2D1RenderTarget::PushAxisAlignedClip and ID2D1RenderTarget::Clear() can be used to "erase" a rectangular region. Works on Windows 7 RTM.
https://msdn.microsoft.com/en-us/library/windows/desktop/dd742775(v=vs.85).aspx

Related

Reduce blink windows phone 7 flash

What is the best approach to set a Windows Phone 7 led to torch mode? I have used http://www.locked.nl/wp7-flashlight-getting-started but using reflection and/or the VideoCaptureDevice is not allowed. (only works on dev phone)
I have used the AutoFocusCompleted event and have tried a task (taskfactory.new) and regular task. My latest attempt uses the DispatcherTimer.
So what is the best approach to keep calling Focus and/or FocusAtPoint to minimize the blinking and get the closest to a constant light.
Windows Phone 7 - Camera Flash App Not Functioning

windows 8 glass effect

I am asking how to make a glass effect for winform in windows 8.
I just saw some methods which call the DWM to make this before windows 8. But it seems DWM was no longer valid in windows 8. So is there any other methods to make glass effect winform in windows 8?
Thanks!
Windows 8 does not provide support for the glass effect of Vista/7. If you want to make your windows display with glass effect, you need to code it yourself, or use one of the 3rd party solutions that do so.

GetRandomRgn() Api does not work as expected in Windows 8

I am using GetRandomRgn() API to get the visible region of the window.
This API works fine in Windows Xp and Windows 7 but same API is not giving the same
result in Windows 8.
Is there is any other function available in windows 8 to give me the same result?
Please do reply.
Best Regards,
Sharad
Enable Desktop Composition on Windows 7 and you'll see that Windows 7 and Windows 8 behave the same. The behavior of GetRandomRgn is affected by desktop composition. When composition is enabled, all windows are logically treated as fully visible (since they render to an offscreen buffer). The available of features like Flip3D shows that the logically visible portion of a region is not the same as its physically visible region.

blend 4 and layout path

according to this article http://electricbeach.org/?p=653 and many others it's trivial to make a layout path.
Well I've downloaded phone 7 developer kit but when I try to convert a shape (es. circle) to layout path is impossible because command is not active.
Also pathlistbox don't exist in my blend version... you know why?
You can only use the PathListBox in Silverlight 4 onwards, which is available on the Mango build of Windows Phone 7. You will need to download and install the Developer Tools for Windows Phone Mango.

Windows 7 snap - Programmatic aspect

Windows 7 has a new "snap" feature it applies when dragging "standard" windows. I do have a pure win32 application (not MFC or any other framework) that I use to create a non-orthodox user-drawn window.
That window does not "conform" to windows 7 snap and dragging it to screen corners will not do anything.
Do I need a special style/class or something similar in my window in order for windows 7 to take it into consideration for "snapping"
You will have to use the WindowChrome class which is in the Microsoft.Windows.Shell namespace available in .NET 4. If you are targeting .NET 3.5 SP1 there is a backported standalone library, details here.

Resources