inkcanvas

UWP: How can I attach an image to an InkCanvas?

吃可爱长大的小学妹 提交于 2019-12-02 12:29:07
I have to capture a photo with camera or loading it from file into a canvas which should be edited for highlighting some stuff on it after that saved into a folder. As for now I use this: <Grid x:Name="grid"> <Image Source="/Assets/stainless-images-110606.jpg" x:Name="ImageToEdit" Stretch="Uniform" /> <StackPanel Background="LightGreen" Width="700" Height="700" x:Name="StackPanel"> <InkCanvas x:Name="MyInkCanvas" Width="{Binding Width, ElementName=StackPanel}" Height="{Binding Height, ElementName=StackPanel}"/> </StackPanel> <InkToolbar TargetInkCanvas="{x:Bind MyInkCanvas}" Name="inkToolbar"/

How to save and load InkCanvas gif file at fixed location without FilePicker

这一生的挚爱 提交于 2019-12-02 06:44:09
问题 I want to save and load InkCanvas gif file without FilePicker . I saw a sample using FilePicker , but I want to save the gif file automatically when I click the save button. For example, when I save 1 InkCanvas gif file, Then the gif file is saved at in a specific folder on my C: drive. I also want the file name grow automatically, so that I can load specific InkCanvas file. Is this possible? 回答1: UWP apps run in a sandbox, so that the user can know what the app is doing and which files on

How to save and load InkCanvas gif file at fixed location without FilePicker

浪子不回头ぞ 提交于 2019-12-02 04:34:44
I want to save and load InkCanvas gif file without FilePicker . I saw a sample using FilePicker , but I want to save the gif file automatically when I click the save button. For example, when I save 1 InkCanvas gif file, Then the gif file is saved at in a specific folder on my C: drive. I also want the file name grow automatically, so that I can load specific InkCanvas file. Is this possible? UWP apps run in a sandbox, so that the user can know what the app is doing and which files on her hard drive it accesses. In case you want to save files to a location on the user's hard drive, you will

How to turn off all touch input at application, window or control level?

帅比萌擦擦* 提交于 2019-11-30 07:36:23
问题 Using c# for a wpf application, if in Windows 7 touch is enabled in the control panel, a user by default can 'write' on an InkCanvas with a finger. I want to disable that and force stylus input only. I'd like to know how to do it more than one way if possible: first by disabling touch on the InkCanvas , second by disabling it for a particular window, and third by disabling it for the entire application. A bonus fourth would be knowing how to turn touch on or off system-wide. I have tried

saving WPF InkCanvas to a JPG - image is getting cropped

僤鯓⒐⒋嵵緔 提交于 2019-11-30 06:38:53
问题 I have a WPF InkCanvas control I'm using to capture a signature in my application. The control looks like this - it's 700x300 However, when I save it as a JPG, the resulting image looks like this, also 700x300 The code I'm using to save sigPath = System.IO.Path.GetTempFileName(); MemoryStream ms = new MemoryStream(); FileStream fs = new FileStream(sigPath, FileMode.Create); RenderTargetBitmap rtb = new RenderTargetBitmap((int)inkSig.Width, (int)inkSig.Height, 96d, 96d, PixelFormats.Default);

saving WPF InkCanvas to a JPG - image is getting cropped

[亡魂溺海] 提交于 2019-11-28 20:57:08
I have a WPF InkCanvas control I'm using to capture a signature in my application. The control looks like this - it's 700x300 However, when I save it as a JPG, the resulting image looks like this, also 700x300 The code I'm using to save sigPath = System.IO.Path.GetTempFileName(); MemoryStream ms = new MemoryStream(); FileStream fs = new FileStream(sigPath, FileMode.Create); RenderTargetBitmap rtb = new RenderTargetBitmap((int)inkSig.Width, (int)inkSig.Height, 96d, 96d, PixelFormats.Default); rtb.Render(inkSig); JpegBitmapEncoder encoder = new JpegBitmapEncoder(); encoder.Frames.Add(BitmapFrame

Wpf InkCanvas save stokes as svg

China☆狼群 提交于 2019-11-28 06:02:50
问题 Is it possible to save InkCanvas stroke collection to svg image? Only thing I can find is that I can save the strokes as GIF with embedded ISF (Ink Serialized Format) or maybe render them as bitmap. I want to save strokes in vector format that can be interoperable with other platforms (like web). 回答1: I figured it out. Here are the steps Iterate over the StrokeCollection Get PathGeometry of each Stroke by calling GetGeometry function and then calling GetOutlinedPathGeometry . Get Figures out

Displaying a background image on a UWP ink canvas

十年热恋 提交于 2019-11-26 20:48:03
问题 I have an InkCanvas in my UWP app, and would like to display an image (ideally as part of the Canvas, but otherwise, overlay it in some way (the idea being that I can save the changed image back to the image file). WPF seems to allow the InkCanvas to have children, but in UWP that doesn't seem to be possible. I've tried the following: <InkCanvas x:Name="drawInkCanvas"> <Image Source="{Binding DrawingImage}"/> </InkCanvas> But that doesn't work; I've also tried this: <Grid Grid.Row="1" Grid