locked
Problem with Windows 8 Paint implementation (using XAML) RRS feed

  • Question

  • Hi.
    I am learning XAML and i wan't to practice on a simple Windows 8 application which is implementation of Paint. But right at the start I am verry stuck. First of all i want to implement the PEN tool but I dont have any idea how to do it. Can anyone explain то me how to do it.

    Thank you! :)
    • Moved by Jason Dot Wang Friday, October 11, 2013 5:46 AM This thread is about Building Windows Store apps with C# or VB
    Thursday, October 10, 2013 11:52 AM

Answers

  • Which part are you stuck on?

    You can receive pen input through pointer events. What to do with these depends on what your intent is. Likely options are to create a vector Path from point to point, use a WriteableBitmap and modify the pixels to the new point, or pass the points to an InkManager to treat them as ink.

    For a "Paint" like program modifying raster pixels in a WriteableBitmap is probably what you want. There are no high level raster drawing functions built in. You will either need to extract the WriteableBitmap's pixel buffer and then implement your own drawing routines on them or use a library (either 3rd party such as WriteableBitmapEx or dropping down to Direct2D) to do the actual drawing.

    --Rob

    Friday, October 11, 2013 6:07 AM
    Moderator
  • Friday, October 11, 2013 10:16 AM

All replies

  • Hi dotNETjrr,

      Welcome to MSDN Forum Support.

      You are more likely to get more efficient responses to Building Windows Store apps with C# or VB issues at https://social.msdn.microsoft.com/Forums/windowsapps/en-US/home?forum=winappswithcsharp where you can contact Building Windows Store apps with C# or VB  experts,so I would like to redirect you to appropriate forum for
    better responses.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, October 11, 2013 5:45 AM
  • Which part are you stuck on?

    You can receive pen input through pointer events. What to do with these depends on what your intent is. Likely options are to create a vector Path from point to point, use a WriteableBitmap and modify the pixels to the new point, or pass the points to an InkManager to treat them as ink.

    For a "Paint" like program modifying raster pixels in a WriteableBitmap is probably what you want. There are no high level raster drawing functions built in. You will either need to extract the WriteableBitmap's pixel buffer and then implement your own drawing routines on them or use a library (either 3rd party such as WriteableBitmapEx or dropping down to Direct2D) to do the actual drawing.

    --Rob

    Friday, October 11, 2013 6:07 AM
    Moderator
  • Friday, October 11, 2013 10:16 AM