Home > Net >  C # drawing
C # drawing

Time:09-24

Has a task, with a bunch of points, each point has X and Y values, X bigger probably all of them in more than 10000, each point of the X value relatively small fluctuations, Y value at about 100 less than, to try to portray these points out now, I own the whole of the code, as X value beyond the window, according to the pixel size so can't I want to ask next everybody this case how to write code? Stick out my own code, need to modify the code? Trouble you
 
Graphics g=Graphics. FromHwnd (enclosing the Handle);

Pen p=new Pen (Color Black);

P.E ndCap=LineCap. ArrowAnchor;

G.D rawLine (p, new Point (100, enclosing Height - 100), new Point (enclosing Width - 100, enclosing Height - 100));

G.D rawString (" x ", enclosing the Font, new SolidBrush (Color. Black), new Point (enclosing Width - 100 + 5, enclosing Height - 100));

P.E ndCap=LineCap. ArrowAnchor;

G.D rawLine (p, new Point (150, enclosing Height - 50), new Point (150, 100));

G.D rawString (" y ", enclosing the Font, new SolidBrush (Color. Black), new Point (150, 100-20));

Int pointCount=2;

PointX=new float float [] [] 11221.00 f} {12213.00 f,;

PointY=new float float [] [] 33.1 f} {32.4 f,;

PointF [] PointF=new PointF [pointCount];

for (int i=0; I & lt; PointCount; I++) {

PointF [I]=new pointF (pointX [I], pointY [I]);

}

G.D rawCurve (p, pointF, 1 f);

Conviction yourself ispose ();

G.D ispose ();

CodePudding user response:

Reference curve of excel, the x axis is change the unit, such as screen 1 pixel represents actual 100 pixels,

CodePudding user response:

The only need to set the starting point of the x coordinate to around 10000

CodePudding user response:

The code for how to change?
  •  Tags:  
  • C#
  • Related