Using system; using system.drawing; using system.drawing.imaging;
Namespace ktest {/// /// kbuilder's summary description.
/// summary> public class kbuilder {private int bottom = 10; private int = 20; /// /// default width /// summary> private int m_width = 640; /// /// Height default 400 pixels /// summary> private int m_height = 480; /// /// Default display 30 days data /// summary> private int m_linecount = 30; /// /// The default display is 50 yuan /// summary> private int m_maxprice = 50; /// /// store price list /// summary> private arraylist M_Price; public kbuilder () {m_price = new arraylist ();} /// /// width /// summary> public int width {incount {m_width;} set {m_width = value;}} /// /// Height /// summary> public int Height {get {return m_height;} set {m_height = value;}} /// /// display line number ///// summary> public int linecount {get {return {m_Linecount;} set {m_linecount = value;}} public int markprice {incker {return m_maxprice;} set {m_maxprice = valu e;}} /// /// Add price /// summary> /// open price param> /// The highest price param> /// lowest price param> /// Closed price param> public void add (double openprice, double maxprice, Double Minprice, Double ClosePrice) {ktest.price a = new price (); a.open = openprice; a.max = maxprice; a.min = minprice; a.close = closeprice; if (m_prices.count> =
M_LineCount) {m_price.removeat (0);} m_price.add (a);} /// /// returns> Public Bitmap getImage ) {Bitmap image = new bitmap (m_width, m_height); graphics g = graphics.fromimage (image); pen black1 = new pen (color.black, 1); pen black2 = new pen (color.black, 2); pen Red = new pen (color.red, 1); Point O = New Point (LeftMarge, M_Height-Bottommarge); Point Y = New Point (LeftMarge, 0); Point X = New Point (m_width, m_height-bottommarge); font Font = New font ("Song", 8); int hstep = (m_height-bottommarge) / m_maxprice; int wstep = (m_width-leftmarge) / m_LineCount;