none
[UWP]AutoSave and AutoLoad stroke InkCanvas RRS feed

All replies

  • Hi,

    Could you please explain your requirement with more details? I do not understand the requirement.

    What do you mean by "save the stroke and load the app when there will bee"? Where is the stroke? In the inkcanvas of an app or it is just a file saved in the devie? Does load the app mean open the file by your UWP app?

     Do you mean you want to save the file in two different apps?

    Please tell me what's your excepted behavior. Divide them into several specific steps so I could try to find a way to do it.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, July 5, 2018 2:14 AM
    Moderator
  • Hello:

    I want to make the draw and close the App Uwp and I will get the last drawing I did InkCanvas. but here I do not use button save

    Thursday, July 5, 2018 10:26 AM
  • Hi,

    There are different ways to save the ink strokes in to files automatically.

    First you could try to build a DispatcherTimer to do that. You could save the ink strokes a specified interval of time using DispatcherTimer.

    Another way is that you could handle the Close Request of the UWP app, save the ink strokes into files first and then close the app. You need to handle the SystemNavigationManagerPreview.CloseRequested Event which is triggered when the close button is clicked. To use this API, you will need to add confirmAppClose restricted capability in Package.appxmanifest file. Like this:

    <rescap:Capability Name="confirmAppClose" />
    You could refer this sample for more information about this API.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, July 6, 2018 6:15 AM
    Moderator
  • var fs = new FileStream(inkFileName,
                    FileMode.Open, FileAccess.Read);
    StrokeCollection strokes = new StrokeCollection(fs);
    inkCanvas1.Strokes = strokes;

    When I put the code APRA load the stroke tells me qu StrokeCollection nose found or missing a directive or reference, where it puts MyCanvas. Strokes tells me fault in strokes.
    Friday, July 6, 2018 3:58 PM
  • Hi,

    What's the error? Could you please share me the detail error message?

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, July 9, 2018 3:26 AM
    Moderator
  • As I can do AutoSave and Autoload when the user does something in the InkCanvas
    Monday, August 27, 2018 7:50 AM