Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
Hi, I want to make a Paint like App(pencil, text, eraser, lines & shapes drawings) with ability to resize shapes & edit Text at any time (Like Microsoft PowerPoint) in WPF.
 

My Question is : What Tools should I use? (for some reasons I don't want to use Inkcanvas)
 
And how to make my own custom drawing brush (for example using an Image for that) or just a soft edge brush?
 
Sorry I am asking a lot, but I was able to do all that in winForm Applications.
 
<Thanks To="All" Regards="Best"></Thanks>
Posted 20-Jan-13 18:56pm
Edited 20-Jan-13 18:57pm
v2
Comments
Sergey Alexandrovich Kryukov at 21-Jan-13 0:01am
   
You request something which would need a really big time-consuming post. At the same time, you limit some of your explanation by "for some reasons"...
—SA
Abed AlSayed at 21-Jan-13 0:08am
   
I don't want to use inkcanvas because it doesn't support adding images(that what I know), I was thinking to add images like this <image .../> but another problem that is the Order of the images(the drawing will be on the top and images on the bottom)
Sergey Alexandrovich Kryukov at 21-Jan-13 1:08am
   
I see... but anyway, you should not use XAML at all for graphics. More exactly, you can only used it as a file format, if you want. And for UI design, outside your drawing. There is no "design-time" for graphic editor.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

This is quite doable, but, in my view, unfortunately, even the initial directions and ideas would take too much work.
 
So, roughly speaking, for pixel graphics, you can use DrawingVisual and, for vector — Canvas. You can combine different approaches and do many different things. Please see:
http://msdn.microsoft.com/en-us/library/ms742254.aspx[^],
http://msdn.microsoft.com/en-us/library/ms753209.aspx[^];
http://msdn.microsoft.com/en-us/library/system.windows.controls.canvas.aspx[^],
http://wpftutorial.net/Canvas.html[^].
 
WPF documentation is pretty good; you can find all you need by yourself, just spend some time. Your time Smile | :) .
 
—SA
  Permalink  
Comments
Abed AlSayed at 21-Jan-13 0:20am
   
ok thats Fine, but how about pencil and eraser drawing??
Sergey Alexandrovich Kryukov at 21-Jan-13 0:59am
   
Well, you will need to handle events (with DrawingVisual — on the very low level), add some pixels, remove pixels... Not too easy, anyway...
—SA
Abed AlSayed at 21-Jan-13 17:23pm
   
Ok, please my where I can start?
Sergey Alexandrovich Kryukov at 21-Jan-13 17:59pm
   
You can start where you find it convenient, may be from accepting this answer formally (green button) :-)
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

This is actually harder in WPF, because the logical way to do it, is not to draw on a bitmap, but to keep track of actions and draw them on TOP of your image. At least, that's how I did it when I did it and it was a royal pain
  Permalink  
Comments
Abed AlSayed at 21-Jan-13 0:01am
   
If you did it, did you post an article or anything about it?
Christian Graus at 21-Jan-13 0:02am
   
No, I did it for my job, so I don't own the code to give away.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 390
1 Jochen Arndt 165
2 Richard MacCutchan 135
3 DamithSL 95
4 Garth J Lancaster 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web04 | 2.8.141220.1 | Last Updated 21 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100