inkcanvas

InkCanvas Strokes are not rendered with proper bounds when switching PC

自古美人都是妖i 提交于 2019-12-12 21:25:53
问题 I have one UWP App using a UWP InkCanvas with a Load and Save Ink Buttons. I made a draw with the app on one laptop, saved the ink as a gif (+embedded isf) and sent the gif file to another laptop with a smaller screen to try it out. When opening the ink with the same app but on this other laptop, the draw is clipped at the boundaries, as if it does not fit the screen, which arguably is due to the laptop's smaller screen size. I tried to resize the InkCanvas as a whole by encapsulating it in a

UWP InkCanvas Out Of Memory

痴心易碎 提交于 2019-12-12 17:13:04
问题 I'm using MVVMLight to create a questionnaire and running into memory issues when rendering the InkCanvas controls. Here's a watered down example of what I am working with: QuestionVm public Question Question { get; set; } public HandwritingControl HandwritingControl { get; set; } QuestionnaireVm public List<QuestionVm> currentQuestions; public List<QuestionVm> CurrentQuestions { get { return currentQuestions; } set { currentQuestions = value; RaisePropertyChanged(); } } Questionnaire.xaml.cs

How to remove the InkStroke when using the ActiveCustomDrying in uwp?

纵然是瞬间 提交于 2019-12-11 16:48:52
问题 I used the ActiveCustomDrying to customize the ink, now I want to remove them InkStrokes . StrokeContainer is null because of active the CustomDrying , so I am unable to remove the InkStrokes by using the DeleteSelected method. Can anyone suggest me how to remove the InkStrokes when using the CustomDrying . 回答1: During the custom drying, you will store the strokes in a custom List<InkStrokeContainer> collection: private void InkPresenter_StrokesCollected(InkPresenter sender,

save an image from ink canvas

喜你入骨 提交于 2019-12-11 11:59:04
问题 I am trying to save an image from ink canvas however it does not create any file after saving, this is my code RenderTargetBitmap rtb = new RenderTargetBitmap( (int)canvas.Width, (int)canvas.Height, 0, 0, PixelFormats.Default); rtb.Render(this.canvas); JpegBitmapEncoder encoder = new JpegBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create(rtb)); using(var file = new FileStream(@"C:\test.jpg", FileMode.Create)) { encoder.Save(file); } however it does not create any file even when I change

Custom InkCanvas (MSDN Code Sample not working properly)

…衆ロ難τιáo~ 提交于 2019-12-11 09:55:59
问题 I want to use custom brushes with the InkCanvas. Their is a code snippet from MSDN. (http://msdn.microsoft.com/en-us/library/ms747347.aspx) If i use that code and move my mouse VERY fast i get space between the brushes(ellipses): And my question is of course how to fix this but I'm also curious why this is happening (I want to learn from it) I thought maybe i did something wrong but even if i cut/paste the example it's happening. One little thing i noticed when reading the code was this

Converting InkCanvas Strokes to a Byte Array and back again

我是研究僧i 提交于 2019-12-11 02:19:07
问题 I am working on a program which converts the inkcanvas strokes to a byte array for encryption and then saves it in a txt file. Essentially I need to convert a byte array to inkcanvas strokes. I have the first half of the code done (which converts the inkcanvas strokes to a byte array): private byte[] InkCanvasToByte() { using (MemoryStream ms = new MemoryStream()) { if(myInkCanvas.Strokes.Count > 0) { myInkCanvas.Strokes.Save(ms, true); byte[] unencryptedSignature = ms.ToArray(); return

Event Handlers not working with inkCanvas in Windows Universal App

余生长醉 提交于 2019-12-09 23:49:10
问题 I am not able to make PointerPressed, PointerReleased (any pointer event) work. I have written this line of code to support touch inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Touch; from the solutions that I found online, I have tried this inkCanvas.PointerReleased += inkCanvas_PointerReleased; and this inkCanvas.AddHandler(PointerReleasedEvent, new PointerEventHandler(inkCanvas_PointerReleased), true); and simply through XAML as well: <InkCanvas

Scaling InkStrokes in UWP

醉酒当歌 提交于 2019-12-08 11:18:42
问题 I've got a simple demo application that uses an image as the background of an InkCanvas and I scale the strokes when the display of the image is resized so that they remain in the same place relative to the image. Since you can draw -> resize -> draw -> resize -> draw this means I have to scale each stroke a different amount each time by assigning the PointTransform on each stroke. float thisScale = (float)(scale / _prevScale); foreach (InkStroke stroke in myCanvas.InkPresenter

InkCanvas to BitMap

给你一囗甜甜゛ 提交于 2019-12-08 06:24:32
问题 I have a problem with saving canvas to BMP file (or any other type). I'm trying to save my InkCanvas like this: int margin = (int)canvas.Margin.Left; int width = (int)canvas.ActualWidth -margin; int height = (int)canvas.ActualHeight -margin; //render ink to bitmap RenderTargetBitmap renderBitmap = new RenderTargetBitmap(width, height, 96d, 96d, PixelFormats.Default); renderBitmap.Render(canvas); //save the ink to a memory stream BitmapEncoder encoder; encoder = new BmpBitmapEncoder(); encoder

InkCanvas Load/Save operations

六月ゝ 毕业季﹏ 提交于 2019-12-04 14:57:19
I've never used InkCanvas control before. What I need is to load up a file into InkCanvas , draw some scribbles and get ther resulting image. And I want to make some additional operations with gotten image. As for saving Correct me if I'm wrong. I've found a link: http://www.centrolutions.com/Blog/post/2008/12/09/Convert-WPF-InkCanvas-to-Bitmap.aspx According to the post will be loaded image considered in addition to user scribbles. Or it only converts scribbles to bitmap? As for loading How do I load image using OpenFileDialog? I don't want to use ISF. Thanks! Saving: If you want to be able