473,788 Members | 2,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

graphics drawline - graph - inner lines not showing up?

Hello,

I am trying to draw a graph on a form. I can draw the box
using drawline, and bars inside the box using
drawrectangle, but when I try to draw a line inside the
box the inner lines are not showing up. Do I need to use
a property or something?

Here is the code for my lines

Graphics g = this.CreateGrap hics();
Pen pen2 = new Pen(Color.Blue) ;

g.DrawLine(pen2 , 30, 50, 300, 50); //horizontal top
g.DrawLine(pen2 , 30, 50, 30, 190); //vertical left
g.DrawLine(pen2 , 30, 190, 300, 190); //horizontal bottom
g.DrawLine(pen2 , 300, 50, 300, 190); //vert right
g.DrawLine(pen2 , 70, 50, 70, 190); //vertical inner

The vertical middle line is not showing up. Any
suggestions appreciated what I could do to make the inner
line show up.

Thanks
Nov 16 '05 #1
1 2728
Rebuild the solution.

-----Original Message-----
Hello,

I am trying to draw a graph on a form. I can draw the boxusing drawline, and bars inside the box using
drawrectangl e, but when I try to draw a line inside the
box the inner lines are not showing up. Do I need to use
a property or something?

Here is the code for my lines

Graphics g = this.CreateGrap hics();
Pen pen2 = new Pen(Color.Blue) ;

g.DrawLine(pen 2, 30, 50, 300, 50); //horizontal top
g.DrawLine(pen 2, 30, 50, 30, 190); //vertical left
g.DrawLine(pen 2, 30, 190, 300, 190); //horizontal bottom
g.DrawLine(pen 2, 300, 50, 300, 190); //vert right
g.DrawLine(pen 2, 70, 50, 70, 190); //vertical inner

The vertical middle line is not showing up. Any
suggestions appreciated what I could do to make the inner
line show up.

Thanks
.

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
7594
by: Jean-Philippe Martin | last post by:
Hi all, It's my first post here, so you doubt I have a question :o) I want to develop a mini graphical editor. Imagine that I have 2 JFrame, I want to have one with a list of JToggleButton with a ImageIcon and one called DrawingAeraWind with nothing into. I would like to be able to draw the ImageIcon of the selected JToggleButton in the DrawingAeraWind if I click into this window. I would like to be able
2
3601
by: John Bailo | last post by:
I am walking through some of the very first sample code from the book "Beginning .NET Game Programming" from Apress. I identify his sample code with //SC This code puzzles me: Graphics graph = new Graphics //SC // first of all there is no constructor for Graphics // so in the Form_Paint I use instead:
5
20294
by: Vin | last post by:
Hi, I am using the following code to draw whatever the user draws using x,y. // draws lines directly on a winform. CreateGraphics().DrawLine(APen, x, y, OldX, OldY); Now how do I save the drawing on to a bmp file on my harddisk? C# code in this regard would be very helpful. I tried all forums but invain.
2
1935
by: Coralin Feierbach | last post by:
I created a Windows Form Project using VS.net. I'm trying to draw a line between two points. (Plotting a graph, dynamically) This is the code I have so far: What do I have to do to actually see the line painted on my form? private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
2
10341
by: kalp suth via DotNetMonster.com | last post by:
I want to create arrows using lines on a picture in the picture box. On clicking the button "btnShowAll", the image is loaded and the lines drawn. "RGSShowAll()" calls "DrawObjs()" which does the actual drawing work. But after displaying all the arrows in a flick, the arrows disappers. I have debugged and came to know that the "Paint" event of the picturebox is refreshing the image, so the work done on the CreateGraphics created object is...
7
3040
by: Michael Galvin | last post by:
I am trying to use Python to send to the printer a calender filled with a mix of text and simple graphics. I want to draw on the printed page something like a table with 6 rows and 7 columns to represent a calendar. I want to place text precisely within those boxes on the printed page. I am using Python 2.4 on Windows XP I was in the past able to do this within Visual Basic using its printer object. Visual Basic's printer object uses...
0
238
by: mrajanikrishna | last post by:
Hello, I have generated an image(T-Shirt). It was drawn using lines, curves. After that I filled with color(gr.fillpath(greenBrush,graphicsPath)). I used blackPen to draw lines and curves with stroke 4. After filling the path, The whole image is filled with color. Thats ok but i want to see the borders also. Suppose I hv drawn body of the shirt. Next I need to attach collar and sleeve those are drawn seperately and attached to body....
8
2965
by: Adrian | last post by:
Having plotted a graph from x,y co-ordinate to x,y co-ordinate, the graph disappears immediately (after the last plot). Writing " " to a label, in between subsequent plots, solves this problem. Could someone please shed some light on the cause of this? Thank you, Adrian.
1
2301
by: dosingh | last post by:
i've put this page together using asp, html, javascript amd flash. java passes a number of variables over to the flash file but the flash graph does not appear. The error which appears is SWFObject in undefined. The script tag contained <script type="text/javascript"> but after taking the "text/" out the, the pages shows not error but also not graph!!!! at the end of my tether. PLEASE HELP!!! code is list below <%@LANGUAGE="VBSCRIPT"...
0
10364
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.