| | |
How do you draw a bar
Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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
Views: 842 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access ado.net algorithm array barchart bitmap box broadcast button c# chat check checkbox class client code color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption event excel file files form format forms ftp function gcd gdi+ http httpwebrequest image index input install java label list listbox listener login math mouseclick mysql networking object operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource saving serialization server sleep socket sql statistics stream string tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





