473,394 Members | 1,765 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,394 software developers and data experts.

Setting a Pixel

I think the ability to set a pixel on a graphics surface ought to be
straightforward and I tried to illict Dr. Guis opinion but he was too busy
to respond. So I think he must agree with me but fears authority ;-}
What do others think ? ? ? My original email and Dr. Gui's assistants reply
is shown below.
I'm worried about Dr. GUI and honestly believe he is hoarding the T-Shirts !

In fun
Bob Palank



Dear Dr. Gui

Years ago C and VB allowed us to place a single point on the graphics
surface. I liked _SetPixel(). Now it would seem to me that if you build a
new fancy shmansy language called C#, you ought to be able to place one
colored dot on the screen. Oh I know you can using FillRectangle, but this
seems like hammering a tack with a 10 pound mallet!

Would you ask the powerful people to consider fixing this, or have I missed
something ?

Yours faithfully,

Bob Palank

St. Louis

Thank you for sending a question to Dr. GUI at the Microsoft Developer
Network. Your questions are the

heart of the "Ask Dr. GUI" column. Dr. GUI regrets that due to his many
other duties

he CANNOT provide an individual answer to your question. One of Dr. GUI's
most important and time-consuming

duties is performing lobotomies on marketing and management trainees. (Just
joking, boss!) Dr. GUI doesn't

do house calls, either--even though he has been known to do Windows(R).
Instead of providing individual answers, Dr. GUI selects the

most interesting and/or important questions to run in the"Ask Dr. GUI"
column. You can read the column in the MSDN News

printed newspaper, on the MSDN Library CD-ROM, or on the Web at:

http://msdn.microsoft.com.

If your question is selected for a column, Dr. GUI will thank you by sending
you a neato-keen-way-cool MSDN T-shirt.


Nov 16 '05 #1
2 1425
Bob

Sorry Dr. GUI couldn't respond to your question. Why don't you just pinvoke SetPixel

Jackson Davi
-
This posting is provided "AS IS" with no warranties, and confers no right

Nov 16 '05 #2
On Mon, 03 May 2004 22:56:56 GMT, "Bob Palank" <bo*@stlcc.org> wrote:
I think the ability to set a pixel on a graphics surface ought to be
straightforward and I tried to illict Dr. Guis opinion but he was too busy
to respond. So I think he must agree with me but fears authority ;-}


The problem is GDI+ which is either internally based on floating-point
coordinates, or at least pretends that it was. You see, GDI+ doesn't
know about "pixels". GDI+ has never heard of pixels. It provides a
drawing surface with real-world coordinates, hence a single point
would be a mathematical point and therefore invisible.

If you want to draw screen pixels, you have three options:
1. Use P/Invoke and the GDI SetPixel function, as Jackson said.
2. Create a Bitmap and use the Bitmap.SetPixel method.
3. Create a Bitmap, lock it, and set the pixel using bit manipulation.
--
http://www.kynosarges.de
Nov 16 '05 #3

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

Similar topics

6
by: rzed | last post by:
I'm using PIL to generate some images which may be rotated at the user's option. When they are rotated, the original image is cropped in the new image (which is fine), and the corners are black...
12
by: Jacob Weber | last post by:
Hello. Is it possible to specify the exact space between two lines, measured from the baseline of the top line to the ascenders of the second line? I tried adding the space with padding-bottom,...
1
by: James Dean | last post by:
I get the following message when i try to set a pixel in the bitmap.......whats wrong and how can i fix it....... "Additional information: SetPixel is not supported for images with indexed pixel...
1
by: James Dean | last post by:
I set the first 4 index values of the colorpalette to the following: 0 = white; 1 = red; 2 = blue; 3 = OverlapColor(mix of red and blue); So the first 4 bits will be used to to set one...
7
by: TomHL | last post by:
hello, - I have a Bitmap Object named: bmp1 - I already have the numerical values of:red,blue and green colors + I have the X and Y cordinates. How do I set the pixel value via safe code on...
3
by: Marty McFly | last post by:
Hello, I have a control class that inherits from System.Web.UI.WebControls.Button. When I drag this control from the "My User Controls" tab in the toolbox onto the form, I want it to reflect the...
2
by: fripper | last post by:
I want to generate a graphic in a picture box control where the color of each pixel is determined by particular values calculated for each pixel. These values are manipulated in such a way that I...
2
by: fripper | last post by:
I am using VB 2005 and want to generate a graphic in a picture box control where the color of each pixel is determined by particular values calculated for each pixel. These values are manipulated...
1
by: fripper | last post by:
In VB 2005ave a I have a picture control ("pix") on which I want to set each pixel color according to a variable, X, that has been calculated (I'm drawing fractals from the Mandelbrot Set). I use...
0
by: jfmck1965 | last post by:
Bought a used Compaq Presario running win 98. Problem was pixel setting was 640 x 480 and couldnt be changed. Was told a 'Trident' graphics dvr was removed and restoring it would fix the pixel...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
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...

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.