3 Replies - 6920 Views - Last Post: 08 May 2010 - 03:27 PM Rate Topic: -----

#1 machoolah  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 87
  • Joined: 17-May 09

Read/Write color of a pixel

Posted 06 May 2010 - 05:34 PM

Hello there,

This is my first Visual Basic application. I mainly do console applications in C++ and since working with pixels seems to be difficult in C++ I preferred to use VB 2005 for that. What I need to do is to read and save the colors of the pixels of a picturebox located on a form into an array. I then will manipulate the color values and create a new picture. I wonder if somebody could show me how to do that without asking me what my code is. I've struggled the whole day and so far I've realized that to draw a pixel you should draw an ellipsoid like:
e.Graphics.DrawEllipse(Pens.Red, 70, 70, 1, 1)
in the picturebox_paint procedure.

What I need to learn is how to read the color values, and how to initiate creating the new picture by pressing a button (because I don't want the part for drawing a pixel be in the picture_box procedure.)

Any type of help will be highly appreciated.

Thanks


Is This A Good Question/Topic? 0
  • +

Replies To: Read/Write color of a pixel

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1642
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: Read/Write color of a pixel

Posted 06 May 2010 - 05:49 PM

That's VB.NET code so I'm moving this to the VB.NET forum :)
Was This Post Helpful? 0
  • +
  • -

#3 snikmotnairb  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 13
  • View blog
  • Posts: 70
  • Joined: 02-May 08

Re: Read/Write color of a pixel

Posted 07 May 2010 - 08:45 AM

This might help:

http://www.daniweb.c...ead187045.html#

As for doing the picture work in a button press, this is very easy. In Design mode, drag a button onto your form, then, double click the button you just created, Visual Studio SHOULD open up your form and place code there for the Button1.click event. The code would look something like this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

**Place your picture creation code here***

End Sub



Hope that helps
Was This Post Helpful? 1
  • +
  • -

#4 machoolah  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 87
  • Joined: 17-May 09

Re: Read/Write color of a pixel

Posted 08 May 2010 - 03:27 PM

View Postsnikmotnairb, on 07 May 2010 - 07:45 AM, said:

This might help:

http://www.daniweb.c...ead187045.html#

As for doing the picture work in a button press, this is very easy. In Design mode, drag a button onto your form, then, double click the button you just created, Visual Studio SHOULD open up your form and place code there for the Button1.click event. The code would look something like this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

**Place your picture creation code here***

End Sub



Hope that helps



Thanks, it kinda solved my problem. =)
Was This Post Helpful? -1
  • +
  • -

Page 1 of 1