Click here to Skip to main content
16,020,984 members

Comments by yummy02 (Top 66 by date)

yummy02 6-Feb-11 20:23pm View    
Yes, last time I forgot to vote. Sorry :)
yummy02 3-Feb-11 21:53pm View    
+5 :) Now I realized it's so true..
yummy02 3-Feb-11 21:46pm View    
Thanks :) But Some lines also disappear when I redraw new lines. How can I redraw specific lines and retain others that wasn't move yet by the user. I mean If I have to move specific picturebox, the line connected to this one follow, but the other lines not connected to it remains.
yummy02 1-Feb-11 6:49am View    
Thanks for editing/updating my questions. :)
yummy02 1-Feb-11 5:19am View    
Here my code in Paint Event:

void PaintThis(object sender, PaintEventArgs e)
{

newStruct ST = new newStruct();

xd.Load(filename);
XmlNodeList xnl = xd.SelectSingleNode("root").ChildNodes;



foreach (XmlNode xn in xnl)
{


XmlElement xe = (XmlElement)xn;
XmlNodeList name = xe.GetElementsByTagName("picname");
XmlNodeList x1 = xe.GetElementsByTagName("x1");
XmlNodeList y1 = xe.GetElementsByTagName("y1");
XmlNodeList xc = xe.GetElementsByTagName("xcenter");
XmlNodeList yc = xe.GetElementsByTagName("ycenter");
XmlNodeList x2 = xe.GetElementsByTagName("x2");
XmlNodeList y2 = xe.GetElementsByTagName("y2");

ST.graps = e.Graphics;
Pen myPen = new Pen(System.Drawing.Color.Blue, 3);


for (int j = 0; j < name.Count; j++)
{

ST.x1St = Convert.ToInt32(x1[j].InnerText);
ST.y1St = Convert.ToInt32(y1[j].InnerText);
ST.xcSt = Convert.ToInt32(xcenter[j].InnerText);
ST.ycSt = Convert.ToInt32(ycenter[j].InnerText);
ST.x2St = Convert.ToInt32(x2[j].InnerText);
ST.y2St = Convert.ToInt32(y2[j].InnerText);
ST.halfHeight = 50;
ST.halfWidth = 50;


//DRAW LINES IN PANEL THROUGH POINTS
ST.graps.DrawLine(myPen, ST.x1St + ST.halfWidth, ST.y1St + ST.halfHeight, ST.xcSt, ST.ycSt + ST.halfHeight);
ST.graps.DrawLine(myPen, ST.xcSt, ST.ycSt + ST.halfHeight, ST.xcSt, ST.x2St);
ST.graps.DrawLine(myPen, ST.xcSt, ST.x2St, ST.x2St, ST.y2St);

}
}
}