473,802 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Setting Pixel Colors Programmaticall y in VB 2005

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 function of the value of X
for that pixel as a percentage of LimitX. For example, I could calculate
int(csng(X / LimitX) * 255) and use that value as the red, green and blue
components of myColor. My problem is I don't know how to set the RGB
components of myColor. I've tried using the FromArgb method but without
success.

Ideally I would like the user to be able to select two colors (call them A
and B) and then let myColor be in the range A to B based on value of X.

Can someone talk about setting pixel colors programatically ... or direct me
to an article that talks about it?

Thanks very much.


Jan 29 '06 #1
1 1549
fripper wrote:
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 function of the value of X
for that pixel as a percentage of LimitX. For example, I could calculate
int(csng(X / LimitX) * 255) and use that value as the red, green and blue
components of myColor. My problem is I don't know how to set the RGB
components of myColor. I've tried using the FromArgb method but without
success.

Ideally I would like the user to be able to select two colors (call them A
and B) and then let myColor be in the range A to B based on value of X.

Can someone talk about setting pixel colors programatically ... or direct me
to an article that talks about it?

Thanks very much.


I don't know much about it but you can use the GetPixel and SetPixel
methods of a bitmap object. Might be able to do what you want w/ it

Chris
Jan 29 '06 #2

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

Similar topics

1
2001
by: pavel.kosina | last post by:
I would need to get at canvas pixel color under certain moving widget or better (= faster?) colors/"types" of underlying static widgets that are of polygon shape (not rectangle). How to arrange it without using higher math that must have to compute actual distance of each of point on a polygon? I have found find_overlapping() but its not what I need and do not found something like getColorPixel().
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...
10
3110
by: unknown | last post by:
some one can give me a portable source codes that color a pixel? (env *nix) -- unknown
1
6039
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
3601
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
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...
2
2032
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 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...
30
9090
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 450-1000 milliseconds I want speeds less than 10 milliseconds
7
17463
by: =?Utf-8?B?UmVraGE=?= | last post by:
Hi, I am trying to change the font color for the items in a dropdownlist control at run time using ASP.NET 2.0. DropDownList1.Items.Attributes.Add("style", "color:red"); But when I run the application, I don't see any color change. I am using Visual Studio 2005, ASP.NEt 2.0.
0
9699
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
9562
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10304
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
7598
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
6838
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5494
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
5622
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4270
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
3
2966
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.