473,395 Members | 2,783 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,395 software developers and data experts.

Draw on pixel point with GDI+

Hi there,
Im looking for a solution to draw a one pixel sized point to a graphics
control. E.g. DrawLine(10,10, 11,11) draws 2 pixels, DrawLine(10,10,
10,10) has no effect.
How to do?
Thanks
Pat

Nov 16 '05 #1
4 12754
Did you try DrawRectangle, with width and height 1 pixel each?

-vJ

"Pat Keel" <pa******@freesurf.ch> wrote in message
news:40***********************@news.sunrise.ch...
Hi there,
Im looking for a solution to draw a one pixel sized point to a graphics
control. E.g. DrawLine(10,10, 11,11) draws 2 pixels, DrawLine(10,10,
10,10) has no effect.
How to do?
Thanks
Pat

Nov 16 '05 #2
Vijaye Raji schrieb:
Did you try DrawRectangle, with width and height 1 pixel each?

-vJ

"Pat Keel" <pa******@freesurf.ch> wrote in message
news:40***********************@news.sunrise.ch...
Hi there,
Im looking for a solution to draw a one pixel sized point to a graphics
control. E.g. DrawLine(10,10, 11,11) draws 2 pixels, DrawLine(10,10,
10,10) has no effect.
How to do?
Thanks
Pat

Hi Vijaye,
Yes, unfortunately DrawRectangle with width and height of 1 gives a
square of total 4 pixel. I testet it with the magnifiying glass function
of WinXP.
Any other solutoins?

Nov 16 '05 #3
ooops. Sorry. I should have said FillRectangle. DrawRect, uses a pen to
draw a border, FillRect, doesn't.

-vJ

"Pat Keel" <pa******@freesurf.ch> wrote in message
news:40***********************@news.sunrise.ch...
Vijaye Raji schrieb:
Did you try DrawRectangle, with width and height 1 pixel each?

-vJ

"Pat Keel" <pa******@freesurf.ch> wrote in message
news:40***********************@news.sunrise.ch...
Hi there,
Im looking for a solution to draw a one pixel sized point to a graphics
control. E.g. DrawLine(10,10, 11,11) draws 2 pixels, DrawLine(10,10,
10,10) has no effect.
How to do?
Thanks
Pat

Hi Vijaye,
Yes, unfortunately DrawRectangle with width and height of 1 gives a square
of total 4 pixel. I testet it with the magnifiying glass function of
WinXP.
Any other solutoins?

Nov 16 '05 #4
Hi Vijaye,
This makes the job! Thank You!
SolidBrush b = new SolidBrush(Color.Black);
g.FillRectangle(b, x, y, 1,1);
Nice workaround.
Best Regards
Pat

Vijaye Raji schrieb:
ooops. Sorry. I should have said FillRectangle. DrawRect, uses a pen to
draw a border, FillRect, doesn't.

-vJ

Nov 16 '05 #5

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

Similar topics

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...
1
by: John | last post by:
How can I draw single 1x1 pixel "dot" in window? Not a line, I really mean "dot".
0
by: Pat Keel | last post by:
Hi there, Im looking for a solution to draw a on pixel sized point to a graphics control. E.g. DrawLine(10,10, 11,11) draws 2 pixels, DrawLine(10,10, 10,10) has no effect. How to do? Thanks Pat
1
by: Pat Keel | last post by:
Hi there, I'm looking for a solution to draw a one pixel sized point to a graphics control. E.g. DrawLine(10,10, 11,11) draws 2 pixels, DrawLine(10,10, 10,10) has no effect. How to do? Thanks...
6
by: felix | last post by:
Hi, I have an Image that is drawn with Graphics.DrawImage(..). What I want to do is drawing it with a given transparency, e.g. at an alpha of only 180 instead of 255. How am I doing that?!?!?...
3
by: Richard | last post by:
I have a requirement to put a GDI style circle or rectangle border around the selected row of a datagrid/ It will overlap into the row above and below the selected row. Doing this in a the OnPaint...
8
by: Oberfuhrer | last post by:
I am an old mathematician, who in my sparetime work on a topic oriented math application. I have converted from old, dry Fortran to the more intuitive and juicy VB.net and Windows. In...
0
by: cmbardon | last post by:
I'm trying to create a form with some rounded controls, and I'm having some problems with the rounding not working correctly. I've tried a couple of different methods for creating the graphics...
12
by: active | last post by:
I've been looking on the Internet for a way to convert a DIB to a Bitmap without success. Now I'm wondering if that is the approach I should be taking. All I want to do is display the DIB or...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.