473,473 Members | 1,782 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Setting Pixel Color in VB 2005

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 in such a way that I come up
with three values (each in the range 0-155) 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 #1
2 2013
"fripper" <yo***@indiana.edu> schrieb:
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 in such a way that I come up
with three values (each in the range 0-155) 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.


Create a new 'Bitmap' object of appropriate size. Then you can use its
'SetPixel' method to change the color of a certain pixel. The bitmap object
can be assigned to a picturebox' 'Image' property.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jan 24 '06 #2
fripper wrote:
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 in such a way that I come up
with three values (each in the range 0-155) 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.


Dim C as Color = Color.FromArgb(IntAlpha, IntRed, IntGreen, IntBlue)

Chris
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...
18
by: fleemo17 | last post by:
My organization is developing a set of "standards" for websites built inhouse. The first question that comes to mind is what would be a good standard default size for <p> text? 12 point? Which...
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...
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: victor | last post by:
hello, I have several arrays containing (image-) pixel data; I want to display it onto a PictureBox. What is the best Graphics method for it? (MSDN examples talks only about loading it from...
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...
7
by: walter.alex | last post by:
November 16 2005 -- The recent launch of the new 5 year advertising solution from MillionPixelClick.com means the pixel advertising craze will continue unabated. Selling advertising space by 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...
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
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,...
1
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
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.