473,791 Members | 3,097 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12798
Did you try DrawRectangle, with width and height 1 pixel each?

-vJ

"Pat Keel" <pa******@frees urf.ch> wrote in message
news:40******** *************** @news.sunrise.c h...
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******@frees urf.ch> wrote in message
news:40******** *************** @news.sunrise.c h...
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******@frees urf.ch> wrote in message
news:40******** *************** @news.sunrise.c h...
Vijaye Raji schrieb:
Did you try DrawRectangle, with width and height 1 pixel each?

-vJ

"Pat Keel" <pa******@frees urf.ch> wrote in message
news:40******** *************** @news.sunrise.c h...
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(Colo r.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
1656
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 method I make, perhaps each pixel is randomly colored. I know there is the set pixel method, but thats not fast enough for such a large surface. So is there a way for me to prepare the image pixel by pixel without drawing it, and then send it to...
1
5785
by: John | last post by:
How can I draw single 1x1 pixel "dot" in window? Not a line, I really mean "dot".
0
407
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
2248
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 Pat
6
3989
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?!?!? Regards, Felix
3
4266
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 of a subclassed DataGridTextBoxColum dos not seem like a practical way to do it. I have subclassed a DataGrid and overridden the OnPaint as such:
8
10275
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 particular i would like to have options to draw graphics straight to a bitmap object. A typical example would be to save a plot of a function y=f(x) drawn on a control.
0
2036
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 path, including the one from the GDI+ FAQ. It's a pretty simple path, and mathematically it looks just fine. When I apply it to a control though, I have two problems. First, the corners on the right side of the control are obviously not rounded...
12
3360
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 draw it into a Bitmap. Is there a graphics method that can help?
0
9669
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10427
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...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10155
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
9029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
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
5559
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2916
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.