win2d

how to get a drawingsession from a canvascontrol (win2d)

爷,独闯天下 提交于 2019-12-10 11:38:43
问题 In a win8 app,how to get a drawingsession from a canvascontrol (win2d),or ,how to draw image on canvascontrol out of the function:canvasControl_Draw. 回答1: You cannot - this is a key part of policy provided by CanvasControl. This ensures that: the drawingsession is created and closed at the appropriate time drawing isn't attempted before resources have been created handling device lost errors are handled If you want to force a redraw you can use CanvasControl.Invalidate(). Alternatively, you

Capture Image from Kinect v2 Sensor

ε祈祈猫儿з 提交于 2019-12-08 04:19:54
问题 I am new to Kinect development. I am using the Kinect v2 and to create a Windows store application following the Face Basics example found here. I want to be able to capture a face image if the face is engaged. I am having trouble however capturing the image from the Win2D CanvasControl . I am not sure how else I can capture the face image. Can anyone assist me with how I might accomplish this? 回答1: In the Face Basics example, the author is storing the image captured by the Kinect sensor in a

Is Win2D yet available in C++/WinRt?

大憨熊 提交于 2019-12-08 00:41:06
问题 I need to use win2D in my cppwinrt project. Using the Win2D sample file as a model I’ve tried to mimic its setup, putting in the package file for win2d from that project, duplicating the custom build step, but I can’t get it to compile. I remember some talk about Win2D being added soon to the standard cppwinrt headers so that it could be accessed like others of these wonderful cppwinrt interfaces. Is this something that might happen soon? Or does anyone have some really specific instructions

how to get a drawingsession from a canvascontrol (win2d)

三世轮回 提交于 2019-12-06 22:19:28
In a win8 app,how to get a drawingsession from a canvascontrol (win2d),or ,how to draw image on canvascontrol out of the function:canvasControl_Draw. You cannot - this is a key part of policy provided by CanvasControl. This ensures that: the drawingsession is created and closed at the appropriate time drawing isn't attempted before resources have been created handling device lost errors are handled If you want to force a redraw you can use CanvasControl.Invalidate() . Alternatively, you may find that you want to render to an offscreen CanvasRenderTarget (that you can call CreateDrawingSession)

How to calculate the height of a FontFamily with Win2D (Line Spacing)?

删除回忆录丶 提交于 2019-12-06 19:44:56
问题 I would like to know how to calculate the height of a given a font (with its properties, like size, weight, style...) in a Window Universal Application using Win2D. I previously used a CanvasTextLayout , but it requires a text to work, like in this line: var ctl = new CanvasTextLayout(session, "Some text", new CanvasTextFormat(), constraintWidth, constraintHeight ); In my case, I will NOT have a text because what I'm looking for is the height in which all the glyphs of a given font (with its

Is Win2D yet available in C++/WinRt?

五迷三道 提交于 2019-12-06 12:23:52
I need to use win2D in my cppwinrt project. Using the Win2D sample file as a model I’ve tried to mimic its setup, putting in the package file for win2d from that project, duplicating the custom build step, but I can’t get it to compile. I remember some talk about Win2D being added soon to the standard cppwinrt headers so that it could be accessed like others of these wonderful cppwinrt interfaces. Is this something that might happen soon? Or does anyone have some really specific instructions for using Win2D in the current Visual Studio 2017 environment? I’m in the Insider preview program but

Drawing editable and selectable shapes with Win2D?

对着背影说爱祢 提交于 2019-12-06 08:13:29
问题 I've used System.Windows.Shapes before to add Shapes to Canvas -controls. They can be used like objects and the visuals change as I edit the fields. I can also add event handlers for clicks etc. I'd need this kind of functionality by using Win2D . Is there any easy way? I'm trying to create a simple app like this: User can draws shapes to canvas Shapes can be selected and highlighted by clicking Selected shapes's can be manipulated (color, opacity, width, height, position etc) Shapes can be

How to calculate the size of a piece of text in Win2D

社会主义新天地 提交于 2019-12-05 03:43:43
I am writing an application for Windows 10 using Win2D and I'm trying to draw a shape which scales dynamically to fit whatever text happens to be in it. What I'd like to do is work out how big a particular string would be with a given CanvasTextFormat and then use that to set the size of the shape. My problem is I can't seem to find a way of working out how big the string will be? See code below to calculate the required size (look for "theRectYouAreLookingFor") private void CanvasControl_Draw(CanvasControl sender, CanvasDrawEventArgs args) { CanvasDrawingSession drawingSession = args

How to calculate the height of a FontFamily with Win2D (Line Spacing)?

你。 提交于 2019-12-05 01:12:14
I would like to know how to calculate the height of a given a font (with its properties, like size, weight, style...) in a Window Universal Application using Win2D. I previously used a CanvasTextLayout , but it requires a text to work, like in this line: var ctl = new CanvasTextLayout(session, "Some text", new CanvasTextFormat(), constraintWidth, constraintHeight ); In my case, I will NOT have a text because what I'm looking for is the height in which all the glyphs of a given font (with its style, size, weight...) are fit. EDIT: I have also tried with the CanvasFontFace class, but it seems it

Drawing editable and selectable shapes with Win2D?

这一生的挚爱 提交于 2019-12-04 13:33:12
I've used System.Windows.Shapes before to add Shapes to Canvas -controls. They can be used like objects and the visuals change as I edit the fields. I can also add event handlers for clicks etc. I'd need this kind of functionality by using Win2D . Is there any easy way? I'm trying to create a simple app like this: User can draws shapes to canvas Shapes can be selected and highlighted by clicking Selected shapes's can be manipulated (color, opacity, width, height, position etc) Shapes can be layered over each other (Z-index) I guess one way would be to create custom Shape classes with Draw