How to disable smoothing for Stroke ?
-
2012년 7월 23일 월요일 오전 8:01
Hello,
I am trying to boost performance of drawing, I am not using the built it Ink for InkCanvas,
instead I am creating a System.Windows.Ink.Stroke and place it on a Canvas, then I add points
to its StylusPointCollection when I have new points from input module ...
I couldn't use the built in drawing feature for InkCanvas, because I am not using a real mouse, instead, I just receive new coordinates and draw them
As a result, I didn't have the same performance of the built in drawing feature for InkCanvas
How can I disable smoothing for System.Windows.Ink.Stroke ? I didn't find any related property for DrawingAttributes
So, any idea please ?
Also, as for the InkCanvas, is it possible to use it's native ink drawing by just passing coordinates only ?if not, why its so fast ? what's the secret of its high sampling rate responsiveness ?<html:span id="textmarked_95" name="textmarker_96" style="background-color:#99ff99;"></html:span><html:span id="textmarked_94" name="textmarker_95" style="background-color:#99ff99;"></html:span><html:span id="textmarked_93" name="textmarker_94" style="background-color:#99ff99;"></html:span><html:span id="textmarked_92" name="textmarker_93" style="background-color:#99ff99;"></html:span><html:span id="textmarked_91" name="textmarker_92" style="background-color:#ccccff;"></html:span> :-)<html:span id="textmarked_89" name="textmarker_90" style="background-color:#99ff99;"></html:span><html:span id="textmarked_88" name="textmarker_89" style="background-color:#99ff99;"></html:span>
Thanks in advance<html:span id="textmarked_86" name="textmarker_87" style="background-color:#99ff99;"></html:span><html:span id="textmarked_85" name="textmarker_86" style="background-color:#99ff99;"></html:span><html:span id="textmarked_84" name="textmarker_85" style="background-color:#99ff99;"></html:span>hopewise
모든 응답
-
2012년 7월 24일 화요일 오전 9:29
If you draw it by own code, the performance will be poor, the only way to improve your performance is collect the point, and when mouse up, you clear all points in collect and generate a Path object, and add this Path object to your Canvas.
the default InkCanvas draw by InkPresenter class
http://msdn.microsoft.com/en-us/library/system.windows.controls.inkpresenter.aspx
Stay hungry, stay foolish
-
2012년 7월 24일 화요일 오전 9:47
> the only way to improve your performance is collect the point, and when mouse up, you clear all points in collect and generate a Path object
Do you mean that there is no way to draw real time ink with InkCanvas without using the mouse ? ( I want a way to send points to InkCanvas without using the mouse )
What about the first part of question, can I disable the smoothing for stroke ?
Thanks
hopewise
-
2012년 7월 24일 화요일 오전 10:18
it will cause performance issue.
what is the meaning of "disable the smoothing for stroke"
Stay hungry, stay foolish
-
2012년 7월 24일 화요일 오전 11:23
>what is the meaning of "disable the smoothing for stroke"
I mean to disable the anti-aliasing for the stroke I am drawing, please read the top of this thread again.<html:span id="textmarked_7" name="textmarker_8" style="background-color:#99ff99;"></html:span><html:span id="textmarked_6" name="textmarker_7" style="background-color:#99ff99;"></html:span><html:span id="textmarked_5" name="textmarker_6" style="background-color:#ccccff;"></html:span><html:span id="textmarked_4" name="textmarker_5" style="background-color:#99ff99;"></html:span><html:span id="textmarked_3" name="textmarker_4" style="background-color:#99ff99;"></html:span><html:span id="textmarked_2" name="textmarker_3" style="background-color:#66cccc;"></html:span><html:span id="textmarked_1" name="textmarker_2" style="background-color:#99ff99;"></html:span><html:span id="textmarked_0" name="textmarker_1" style="background-color:#ccccff;"></html:span>
hopewise
-
2012년 7월 25일 수요일 오전 5:58중재자
Hi hopewise,
You could try to RenderOptions property:
RenderOptions.EdgeMode="Aliased"
Best regards,
Sheldon _Xiao[MSFT]
MSDN Community Support | Feedback to us
Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
2012년 7월 26일 목요일 오전 11:09Thanks Sheldon, but, can't I draw on InkCanvas without mouse ? by sending points only ?
hopewise
- 편집됨 hopewise 2012년 7월 26일 목요일 오전 11:09
-
2012년 8월 7일 화요일 오전 6:46중재자
Hi hopewise,
If you could add any objects to your InkCanvas, however, if you do not draw on InkCanvas, add point by point, it will cause performance issue.
best regards,
Sheldon _Xiao[MSFT]
MSDN Community Support | Feedback to us
Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
-
2012년 8월 7일 화요일 오전 7:49
Hi,
I am pretty sure this is not applicable here, but anyway I share my idea here:
Couldn't SnapToDevicePixel help in having plain strokes?Regards,
Charles HETIER http://www.charly-studio.com
-
2012년 8월 9일 목요일 오후 1:16What will speed my drawing is to use the same approach InkCanvas work when user draw by mouse .. can I use the same approach applied by InkCanvas ?
hopewise
-
2012년 8월 10일 금요일 오전 6:10
The methods in inkcanvs class is internal, you cannot use it out of the assembly.
Maybe you can try to write this control by yourself and sharing with us.
NEU_ShieldEdge
- 편집됨 Luke-Skywalker 2012년 8월 10일 금요일 오전 6:14

