简体   繁体   中英

Which control should I use for 2D drawing with WPF?

I want to programatically draw a few simple 2D shapes in a WPF application. Which control should I use for that? I've heard that Canvas can do that but that it's mostly designed to be a container for other controls and not a "drawing" canvas.

Those other controls could be shapes like rectangles, lines, etc., so Canvas may be a good start. If you want to render directly through a function, you could basically use any (user)control as base class, though.

Canvas is meant for drawing, obviously. What is your concern ? if it is Speed, you should have a look on Windows XNA.
Maybe Direct X, Open GL or any library providing access to them could be of some use. Give more details on your needs for an answer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM