Featured post
graphics - Constructing images in C# WPF/MVVM (drawing lines, arcs, text) -
in wpf standalone-application need draw image based on series of 'commands' such "text @ position x,y" , "draw line x1,y1 x2,y2".
my problems , considerations outlined below - , comments appreciated!
the image of water pump constructed our company.
the commands generated proprietory system within our company.
there no problems interpreting commands.
my issue with
a) wpf control should choose draw 'on' ?
b) how can move major part of code unit-testable classes?
a1) have tried pathgeometry, excellent drawing geometric shapes can't draw text.
a2) have tried shape, supports drawing text, less advanced respect geometry.
a3) use strength in each of two, , 'apply' pathgeometry shape?
a4) need handle mouseover after drawing highlight based on mouse position. can done through computing 'behind scenes' object nearest mouse position (though possible, it's heavy!) can choice of rendering control me out?
b1) not expect end drawing subjectable test?
b2) how 'deep' should reference controls belonging in gui? gut feeling says no deeper viewmodel (not business level), higher keep it, more code remains in places can't unit tested.
here answers specific wpf:
you can draw on canvas, wich lets set element's position (canvas.setleft, canvas.settop, ...)
and can use pathgeometry, shape, etc... should have loop @ geometrygroup allows group geometry one.
for text, if want text geometry, can use formattedtext buildgeometry method..
- Get link
- X
- Other Apps
Comments
Post a Comment