473,394 Members | 1,843 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 Individual Pixel Colors in VB 2005

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 come up with three values
(each in the range 0-`55) and I want to use these for the RGB values of the
color of the associated pixel. My question is: In VB 2005 how do I set a
particular pixel to a color with a given set of RGB values? In VB 6 I used
the PSET function but it is not available in VB 2005.
Thanks.
Jan 22 '06 #1
2 3443
Hi,

Use the graphics class fillellipse method with a diameter of 1.

Ken
----------------
"fripper" <yo***@indiana.edu> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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 come up with three values
(each in the range 0-`55) and I want to use these for the RGB values of the
color of the associated pixel. My question is: In VB 2005 how do I set a
particular pixel to a color with a given set of RGB values? In VB 6 I used
the PSET function but it is not available in VB 2005.
Thanks.

Jan 22 '06 #2
In addition to the other comments:

Are you drawing on the screen or a Bitmap?

You can use Bitmap.SetPixel to set an individual Pixel on a bitmap.

Something like:

Dim bm As New Bitmap(256, 256)
For x As Integer = 0 To 256- 1
For y As Integer = 0 To 256- 1
bm.SetPixel(x, y, Color.FromArgb(x, y, 0))
Next
Next
Me.PictureBox1.Image = bm
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"fripper" <yo***@indiana.edu> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
|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 come up with three
values
| (each in the range 0-`55) and I want to use these for the RGB values of
the
| color of the associated pixel. My question is: In VB 2005 how do I set a
| particular pixel to a color with a given set of RGB values? In VB 6 I
used
| the PSET function but it is not available in VB 2005.
| Thanks.
|
|
Jan 24 '06 #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...
10
by: unknown | last post by:
some one can give me a portable source codes that color a pixel? (env *nix) -- unknown
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...
2
by: Bob Palank | last post by:
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...
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...
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...
30
by: Chaos | last post by:
As my first attempt to loop through every pixel of an image, I used for thisY in range(0, thisHeight): for thisX in range(0, thisWidth): #Actions here for Pixel thisX, thisY But it takes...
8
by: Jeff | last post by:
ASP.NET 2.0 I'm wondering how to set the color of a visited HyperLinkField (the link text) in a GridView?? Here is the markup of the HyperLinkField I have problems with: <asp:HyperLinkField...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
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...

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.