예제 #1
0
        private void fc_NativePaint(object sender, NativePaintArgs e)
        {
            // Draw Color Band
            Brush  B  = new SolidBrush(Color.FromArgb(64, Color.Yellow));
            PointF p1 = Chart.GetPointAt(DateTime.Parse(tbStartDate.Text), 0);
            PointF p2 = Chart.GetPointAt(DateTime.Parse(tbEndDate.Text), 0);

            e.Graphics.FillRectangle(B, RectangleF.FromLTRB(p2.X, e.Rect.Top, p1.X, e.Rect.Bottom));

            // Draw Label
            // Get Point of (Date,Price)
            DateTime D     = DateTime.Parse(tbDate.Text);
            double   Price = Chart.GetPriceAt(D, ddlDataType.SelectedItem.Value);
            PointF   p     = Chart.GetPointAt(D, Price);

            if (p != PointF.Empty)
            {
                // Create ObjectLabel
                ObjectLabel ol = new ObjectLabel();
                // Set Stick Align
                ol.StickAlignment = (StickAlignment)Enum.Parse(typeof(StickAlignment), ddlAlign.SelectedItem.Value, true);
                // Set Color and Pos
                ol.BackColor   = Color.FromArgb(255, 192, 64);
                ol.BorderColor = Color.Black;
                ol.Left        = (int)p.X;
                ol.Top         = (int)p.Y;
                if (tbText.Text != null)
                {
                    // Set Text
                    ol.Text = tbText.Text;
                    if (cbAddPrice.Checked)
                    {
                        ol.Text += "\n" + D.ToString("yyyy-MM-dd") + "\n" + Price.ToString("c2");
                    }
                    // Draw Label
                    ol.Draw(e.Graphics);
                }
            }

            // Draw Title & Footer
            Font         F  = new Font("Verdana", 10, FontStyle.Bold);
            StringFormat sf = new StringFormat(StringFormat.GenericDefault);

            sf.Alignment = StringAlignment.Center;

            // Draw Title
            RectangleF R = new RectangleF(0, 0, Chart.Rect.Width, 18);

            e.Graphics.FillRectangle(Brushes.White, R);
            e.Graphics.DrawString(Chart.DataProvider.GetStringData("Name") + "(" + Chart.DataProvider.GetStringData("Code") + ")",
                                  F, Brushes.Black, R, sf);

            // Draw Footer
            R = new RectangleF(0, Chart.Rect.Height + 18, Chart.Rect.Width, 18);
            e.Graphics.FillRectangle(Brushes.White, R);
            e.Graphics.DrawString(Config.CompanyName + "(" + Config.URL + ")",
                                  F, Brushes.Black, R, sf);
        }
예제 #2
0
        private void fc_NativePaint(object sender, NativePaintArgs e)
        {
            //Draw Water Mark
            string s = Config.WaterMarkText;

            if (s != "")
            {
                StringFormat DrawFormat = new StringFormat();
                DrawFormat.Alignment     = StringAlignment.Center;
                DrawFormat.LineAlignment = StringAlignment.Center;

                e.Graphics.DrawString(s, Config.WaterMarkFont,
                                      new SolidBrush(Config.WaterMarkColor), e.Rect, DrawFormat);
            }
        }
예제 #3
0
 public void ObjectManager_DirectPaint(object sender, NativePaintArgs e)
 {
     Draw(e.Graphics, null, null);
 }
예제 #4
0
 public void ObjectManager_ExtraPaint(object sender, NativePaintArgs e)
 {
     //if (DragObject!=null || objects.Count>0)
     SetObjectManager();
     e.NewBitmap = ObjectPaint(e.Graphics, e.NativeBitmap);
 }
예제 #5
0
 private void ObjectManager_ExtraPaint(object sender, NativePaintArgs e)
 {
     e.NewBitmap = ObjectPaint(e.Graphics, e.NativeBitmap);
 }
예제 #6
0
 public void ObjectManager_ExtraPaint(object sender, NativePaintArgs e)
 {
     e.NewBitmap = this.ObjectPaint(e.Graphics, e.NativeBitmap);
 }