Well this is my question, I have a ZedGraph, now I want to put some points in the ZedGraph, I have my simple class Point wich it have, the X & Y values, fist I check this question, but not answered, at the moment don't work, anyone know how to put just a simple point, my goal is drawing shapes like this one Secciones but I dont know how make this
I believe ZedGraph is the wrong tool for what you want to achieve. You should be using GDI+ drawing do draw your points, lines, rectangles and other shapes. It forms part of C#.NET.
Related
A simple graph composed of circles and horizontal and vertical lines that responds to mouse clicks has been implemented in WPF. But the application must be converted to Winforms, no choice in the matter.
GraphicsPath is generally just right for my needs: reasonably simple, it can find hittest points. But to use it, I need to know the equivalent -- or how to calculate -- what WPF's PathGeometry.GetPointAtFractionLength does. (The documentation is too scanty, and I can find no other help on how to do it.)
I am currently exploring oxyplot and wanted to edit a single point in my lineseries. (see image)
For example I want to edit the second point. I want it to be twice the size that it normally is or change the colour. Is that possible without enlarging/changing the colour of all the other points?
I found a way arround it. I drew another graph (scatterseries graph) on the selected point.
I use C# in my work.
I want to render a border with different weigths on its sides.
Like this:
This pictures are from browser, I want to draw corners the same way.
May be the best and the simplest way to implement it is to cut corners from borders at specified angle, like this:
but I have no idea how to cut triangles from image using c# drawing API, and, unfortunately, google doesn't help with this task, there is information only about cropping rectangles.
Any help greatly appreciated.
You could use GraphicsPath for this. Define a path of a number of points (a shape) and perform garphics operations on it just like it was a rectanble.
I'm creating a chart using WPF toolkit. The chart has some lineseries in it. I want to modify the lineseries so that I have smooth lines instead of straight lines. Is that even possible? I've been googling the problem for a while and have not come up with the answer.
Any help would be much appreciated.
If there is no built in series which will achieve what you want, maybe you can create your own which draws splines rather than regular lines.
A quick Google points to this SplineSeries, which may be a good starting point for you.
Perhaps you can look into a Moving Average to smoothen the line.
eg:
chart1.DataManipulator.FinancialFormula(FinancialFormula.MovingAverage, "10", series1, series2);
I want to use custom brushes with the InkCanvas.
Their is a code snippet from MSDN. (http://msdn.microsoft.com/en-us/library/ms747347.aspx)
If i use that code and move my mouse VERY fast i get space between the brushes(ellipses):
And my question is of course how to fix this but I'm also curious why this is happening (I want to learn from it) I thought maybe i did something wrong but even if i cut/paste the example it's happening.
One little thing i noticed when reading the code was this comment in the CustomStroke class
// Draw linear gradient ellipses between
// all the StylusPoints in the Stroke
Seems to me like it should draw ellipses between the points not only at the points.
I'm using C#.NET.
Again in short:
Why is this happening
Help me fix it :)
Why this is happening
The custom InkCanvas in the example draws an ellipse at every collected StrokePoint but makes no attempt to draw lines between them. The standard InkCanvas control is implemented by drawing lines between the points it is given. This is why the custom InkCanvas implementation from the example leaves gaps and the built-in one doesn't.
How to "fix" it
The custom code could easily be extended to not leave gaps: In addition to drawing ellipses at each point, it could draw lines between each pair of points.
Code to draw connecting lines might be added before the code to draw the ellipses, like this:
// Draw connecting lines
var geo = new StreamGeometry();
using(geoContext = geo.Open())
{
geoContext.StartFigure(stylusPoints[0], false, false);
geoContext.PolyLineTo(stylusPoints.Skip(1).Cast<Point>(), true, false);
}
drawingContext.DrawGeometry(null, connectingLinePen, geo);
// Draw ellipses
for(int i = 1; i < stylusPoints.Count; i++)
{
... etc ...
This code works by constructing a polyline StreamGeometry and then drawing it to the context. Using a StreamGeometry in this context is generally more efficient than creating a PathGeometry with a Polyline or doing a bunch of DrawLine calls directly on the drawingCanvas.
Note: Using a better digitizer won't solve the underlying problem, which is that the custom InkCanvas is actually designed to only show data at the sampled points and not in between.
ReDAeR
Look this
http://msdn.microsoft.com/en-us/library/bb531278.aspx
Why this is happening: The WPF InkCanvas control has a limited number of inputs per second when using a mouse; meaning that your stylus inputs will have greater and greater distances between them as you move the mouse faster and faster. The sample itself appears to draw elipses at every stylus input point, not in-between the points.
How to solve this: use a Tablet PC - a digitizer such as on a Tablet PC has a much higher number of inputs per second so it is more difficult to encounter, or fill in the blanks - essentially estimate based on previous points, perhaps a bezier curve.