473,387 Members | 1,365 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to draw a one pixel line

I want draw a line for saperate form, how do i do?

thx
Aug 1 '06 #1
1 1036
Just override the onpaint event of your form and write down :

protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawLine(new Pen(Color.Black), x1, y1, x2, y2);
//x1, y1 is start point and x2, y2 is end point of the line
base.OnPaint (e);
}

cheers ;)
- Angelina

"Sonic" <So***@discussions.microsoft.comwrote in message
news:94**********************************@microsof t.com...
>I want draw a line for saperate form, how do i do?

thx

Aug 1 '06 #2

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

Similar topics

6
by: Rolf Brauser | last post by:
Hello, is it possible to draw a one pixel line around every cell in a table? with "border: 1px solid; " just the outer tableborder ist concerned ? thanks for any help rolf
2
by: Ivan D | last post by:
(planning to do this in C#) plz, if you know tell me :) Im interested in handling the drawing to a surface manually pixel by pixel. For example I want to draw a 640x480 image according to some...
5
by: George | last post by:
I cannot understand how to fix my code so that it will work. It needs to draw a series of lines in different colors and save it to a ppm file. Could someone tell me what I have done wrong. Thanks a...
3
by: ClearWater | last post by:
Please explain in detail include needed code.
2
by: Bob Palank | last post by:
Anyone ever try to place one pixel on the drawing surface ? The code below provides two pixels. When x+1 is changed to x, nothing is drawn. So I guess the shortest line is two pixels. ...
2
by: dan heskett | last post by:
I am owner-drawing a listbox, in an attempt to create a nice list with some custom "fields" and text layout. Essentially it works, but I must be missing something big, conceptually, because I...
1
by: IvoShalev | last post by:
Hi there, I just want to give some sudgestions on how to draw some plain things only using the header file <graphics.hand of course the standart files <stdio.h<conio.h<stdlib.h>. First of All...
18
by: sadegh | last post by:
I am using VC++6. I want to draw some simple shapes (e.g. line, circle, pixel) on a dialog box. How can I do this? Thanks a lot
2
by: cty0000 | last post by:
I need to draw only 1 pixel but I can not found out the way... I tried to use like following in some function (point1 is Point instance) Graphics gB = Graphics.FromImage(gBmp); ...
0
by: Kevinst | last post by:
Hello, currently I am working on the following scenario: There is a device connected to my application. That device has a 256x256 pixel display showing graphics and text. Now for each pixel...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.