| | |
How do you draw a bar
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
here i have written some code for you using GDI that can give you the clue for your problem:
Touraj Ebrahimi [toraj_e] [at] [yahoo] [dot] [com]
C# Syntax (Toggle Plain Text)
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace GDI1 { public partial class Form1 : Form { Pen BluePen = new Pen(Color.Blue, 1); public Form1() { InitializeComponent(); Graphics dc = this.CreateGraphics(); this.Show(); dc.DrawRectangle(BluePen, 0, 0, 50, 50); Pen RedPen = new Pen(Color.Red, 3); Pen pen2 = new Pen(Color.LightSalmon, 10); Pen test = new Pen(Brushes.YellowGreen,8); dc.DrawEllipse(test, 50, 50, 200, 200); Point[] p = new Point[] { new Point(1, 2), new Point(70, 120), new Point(100, 200), new Point(280, 290), new Point(1, 2) }; Point[] p2 = new Point[] { new Point(10, 10), new Point(310, 10), new Point(310, 310), new Point(10, 310), new Point(10, 10) }; dc.FillEllipse(Brushes.YellowGreen, 50, 50, 200, 200); Brush b1 = new System.Drawing.Drawing2D.HatchBrush(System.Drawing.Drawing2D.HatchStyle.Cross, Color.Red); dc.FillEllipse(b1, 50, 50, 100, 100); dc.DrawLine(BluePen, 0, 0, 600, 600); dc.DrawLine(BluePen, 600, 0, 0, 600); dc.DrawLine(RedPen, 0, 300, 600, 300); dc.DrawLine(RedPen, 300, 0, 300, 600); dc.DrawLines(pen2, p2); } } }
Touraj Ebrahimi [toraj_e] [at] [yahoo] [dot] [com]
![]() |
Similar Threads
- How to draw bar chart? (VB.NET)
- problem with scientific calculator! plz help ! (C++)
- Tutorial: Photoshop: create a transparent navigation bar (Graphics and Multimedia)
- hiding progress bar of exporting chart (Visual Basic 4 / 5 / 6)
- graphics.h Borland C (C)
- Tutorial: Photoshop: create a tabbed navigation bar (Graphics and Multimedia)
- bar graph & _POST variables (PHP)
- Internet Explorer has been Hijacked. (Viruses, Spyware and other Nasties)
- IE jacked by http://searchweb2.com (Viruses, Spyware and other Nasties)
Other Threads in the C# Forum
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# capturing check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development drag draganddrop drawing encryption enum error event excel file files firefox form format forms function gdi+ httpwebrequest image index input install java label libraries list listbox listener loop mandelbrot math mouseclick mysql operator path photoshop picturebox pixelinversion port post programming radians regex remote remoting richtextbox running... saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





