Win2D is an easy-to-use Windows Runtime API for immediate mode 2D graphics rendering with GPU acceleration. It is available to C#, C++ and VB developers writing apps for the Windows Universal Platform (UWP). It utilizes the power of Direct2D, and integrates seamlessly with XAML and CoreWindow.
I'm trying to use a CanvasVirtualControl. I noticed that when my window is above a certain size, the drawing is truncated. It seems that the visible region bounds are incorrect.
In the example below, the width of the visible region (as determined from the event args) will not go above 1904, even if I extend the window on two monitors. W.r.t. the height, the behavior seems to be similar, but I cannot actually see the truncation on my setup.
The screenshot is from a maximized window on a 2560x1440 screen. The debug output was obtained by using an explicit invalidation via a mouse click, after the window was maximized. The truncation is apparent on the right side of the screen/window. The width of the window is larger than the width of the total invalidated area, which is larger than the width of what is reported as the visible region (which corresponds to the large rounded rectangle).
If I scroll horizontally, new regions will start to be invalidated and drawn, but they will always 'lag behind' the width of the window.
My expectation is that the size of the visible region should be the same as the size of the scroll viewer's viewport, and that the total invalidated area should be at least as large.
This all looks right to my eyes. Thinking about how to debug this, I wonder, what is your DPI setting on your monitor? Does changing the scaling factor to 100% make this problem go away?
Greetings,
I'm trying to use a CanvasVirtualControl. I noticed that when my window is above a certain size, the drawing is truncated. It seems that the visible region bounds are incorrect.
In the example below, the width of the visible region (as determined from the event args) will not go above 1904, even if I extend the window on two monitors. W.r.t. the height, the behavior seems to be similar, but I cannot actually see the truncation on my setup.
The screenshot is from a maximized window on a 2560x1440 screen. The debug output was obtained by using an explicit invalidation via a mouse click, after the window was maximized. The truncation is apparent on the right side of the screen/window. The width of the window is larger than the width of the total invalidated area, which is larger than the width of what is reported as the visible region (which corresponds to the large rounded rectangle).
If I scroll horizontally, new regions will start to be invalidated and drawn, but they will always 'lag behind' the width of the window.
My expectation is that the size of the visible region should be the same as the size of the scroll viewer's viewport, and that the total invalidated area should be at least as large.
Is this a bug or am I missing something?
Thank you.
xaml:
cpp:
output:
screenshot: