473,806 Members | 2,790 Online
Bytes | Software Development & Data Engineering Community
+ 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 2032
"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
8510
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 (which is not, in this case). I can't find any documented way to change the default fill color (if that's what it is) for the corners, and PIL also doesn't seem to support a flood fill. I have created a flood fill in Python, which works but which...
18
2208
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 begs the question, what unit of measurement should we use for specifying font sizes, points or ems? Thanks. -Fleemo
1
6040
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 formats." this is the code......... bitmap.SetPixel(biheight,biwidth,Color.Black);
7
3603
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 the bmp1 object? (the pixel location based on the X & Y values and it's color based on the red,blue and green values the I already have)
2
4629
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 file ...) Thank you. victor
3
6762
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 following default properties: Height = 32px, Width = 144px. I declare the Width property in my control as... \\\
7
1753
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 pixel the new form of advertising is proving popular with both clients and providers alike. Designed to boost traffic, an image is placed on MillionPixelClick.com with a link to your website. These pixels will be visible for at least 5 years....
2
3466
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 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...
1
1551
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 the statement: pix.SetPixel(i, j, myColor) where i and j are the coordinates of the pixel and myColor is a variable of type Color. Now X has a maximum value that it can attain (call it LimitX) and I want the color of a given pixel to be some...
0
9719
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...
1
10374
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
9193
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
7650
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
5546
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5684
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4330
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 we have to send another system
2
3853
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3010
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.