URGENT!!! PLEASE HELP... *whimpers*, Need Help With system.drawing and the color, brush and

Hi i'm building a raytracing application in VB.Net 2005 EE, and my raytracing app does the following:

  1. Divide A View Window Into A 'Grid' 1 Pixel = 1 Cell/Square
  2. Builds Virtual 3D-SPACE Points On X Y Z Axis, And Adds Them To Lists
  3. Sends A Virtual 'Ray' Of Light Out Of The Grid's Cell
  4. Ray 'Bounces' Off Of The Objects From The 3D Points, Picks Up Red,Green & Blue Colour Values As It Goes Along
  5. When The Ray Returns To The View Window, The Colour Associated With The Cell, Then Becomes The Same As The Colour The Ray Now Has.
  6. The Process Is Repeated With Every Cell.

The Challenge Is This:

Drawing Pixels On The Image, To Match The Colour.

As there is no pixel draw in the graphics base, you have to use the drawellipse, but this requires a pen.

i don't know how to convert a colour which i have specified using color.fromargb(), into a pen.

If anybody could tell me how to convert a colour into a pen, i would really be thankful.

With this piece of info, i will be able to add the completingn parts to the project.

[1148 byte] By [CsNetworks] at [2007-12-23]
# 1
The answer is actually quite simple

Simply create a bitmap object with the dimensions of your view window and set any pixels of the bitmap to the specified colour. Then blast your bitmap to the graphics surface of the view window.

Bitmap bmp = new Bitmap(viewWindow.Width, viewWindow.Height);
bmp.SetPixel(0, 0, pixelColour);

Graphics gfx = viewWindow.CreateGraphics();
gfx.DrawImage(bmp, 0, 0);
bmpDispose();
gfx.Dispose();

Note the above is C# but will only be slightly different for VB.

RabbiJosephGordon at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 2

Dim pen1 as new pen(colour)

This should work...

Sorry I mean

Pen pen1 = new Pen(colour)

AndrewVos at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Base Class Library...
# 3

THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

THANK YOU SOOOOOOOO MUCH BOTH OF YOU!, YOU HAVE NO IDEA HOW MUCH YOU HAVE HELPED ME, CREDIT TO YOU IS GOING IN THE PROGRAM CREDITS (IF YOU DON'T MIND).

AND YOU WILL BE THE FIRST PEOPLE I WILL CONSIDER FOR FREE VERSIONS!!!!

THANK YOU SOOOOOOO MUCH!!!

CsNetworks at 2007-8-30 > top of Msdn Tech,.NET Development,.NET Base Class Library...

.NET Development

Site Classified