Click here to Skip to main content
15,886,027 members
Please Sign up or sign in to vote.
1.00/5 (1 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.

XML
<Thanks To="All" Regards="Best"></Thanks>
Posted
Updated 20-Jan-13 17:57pm
v2
Comments
Sergey Alexandrovich Kryukov 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 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 <inkcanvas ...=""><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 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

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 :-).

—SA
 
Share this answer
 
Comments
Abed AlSayed 21-Jan-13 0:20am    
ok thats Fine, but how about pencil and eraser drawing??
Sergey Alexandrovich Kryukov 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 21-Jan-13 17:23pm    
Ok, please my where I can start?
Sergey Alexandrovich Kryukov 21-Jan-13 17:59pm    
You can start where you find it convenient, may be from accepting this answer formally (green button) :-)
—SA
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
 
Share this answer
 
Comments
Abed AlSayed 21-Jan-13 0:01am    
If you did it, did you post an article or anything about it?
Christian Graus 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900