8 Replies - 639 Views - Last Post: 20 October 2009 - 10:31 AM Rate Topic: -----

#1 JohnorSky  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 137
  • Joined: 02-September 08

Tryting to figure this out...

Post icon  Posted 20 October 2009 - 09:43 AM

Currently my program locates this color: 0, 192, 192

I have that hard coded that into my program... I know how to get the color under the mouse but the color is represented as: #00C0C0

Can I convert "#00C0C0" to 0, 192, 192 somehow? I also have a panel that shows the color under the mouse... can i somehow take that panel and convert it's color to 0, 192, 192?

And what is the formats: 0, 192, 192 and #00C0C0?

I think #00C0C0 might be HEX format?

This post has been edited by JohnorSky: 20 October 2009 - 09:47 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Tryting to figure this out...

#2 PsychoCoder  Icon User is offline

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

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

Re: Tryting to figure this out...

Posted 20 October 2009 - 10:02 AM

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: :code:

Thanks.
Was This Post Helpful? 0
  • +
  • -

#3 MacAnimeGirl  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 282
  • Joined: 30-September 08

Re: Tryting to figure this out...

Posted 20 October 2009 - 10:12 AM

View PostJohnorSky, on 20 Oct, 2009 - 08:43 AM, said:

And what is the formats: 0, 192, 192 and #00C0C0?

I think #00C0C0 might be HEX format?


0, 192, 192 is the rgb values
#00c0c0 is the Hex format

I'm sure you can find a program on the web that can conver the rgb to the Hex.

If you have an image editor it would be even easier.
Was This Post Helpful? 1
  • +
  • -

#4 JohnorSky  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 137
  • Joined: 02-September 08

Re: Tryting to figure this out...

Posted 20 October 2009 - 10:13 AM

View PostPsychoCoder, on 20 Oct, 2009 - 09:02 AM, said:

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Post your code like this: :code:

Thanks.



I can't come up with this out of thin air. Point me in a direction stating how you would go about doing it or send me to a google page or something...


I can post all of the code I have but non of it pertains to converting colors and what not..
Was This Post Helpful? 0
  • +
  • -

#5 MacAnimeGirl  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 282
  • Joined: 30-September 08

Re: Tryting to figure this out...

Posted 20 October 2009 - 10:15 AM

Do you have to convert it?
Was This Post Helpful? 0
  • +
  • -

#6 JohnorSky  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 137
  • Joined: 02-September 08

Re: Tryting to figure this out...

Posted 20 October 2009 - 10:15 AM

View PostMacAnimeGirl, on 20 Oct, 2009 - 09:12 AM, said:

View PostJohnorSky, on 20 Oct, 2009 - 08:43 AM, said:

And what is the formats: 0, 192, 192 and #00C0C0?

I think #00C0C0 might be HEX format?


0, 192, 192 is the rgb values
#00c0c0 is the Hex format

I'm sure you can find a program on the web that can conver the rgb to the Hex.

If you have an image editor it would be even easier.


What I did was use mspaint and i took a screenshot of the color and selected it, when to custom colors and extracted the color "0, 192, 192" from it..

Is there a method to convert Hex to RGB simply in vb.net? I'ma try some more googling on this since I know that one is hex and one is RGB now lol..

And the code I have to locate the color with mouse uses RGB only.. as that is the only way i am familiar with..

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		Dim img As New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
		Dim gr As Graphics = Graphics.FromImage(img)
		gr.CopyFromScreen(New Point(0, 0), New Point(0, 0), New Size(img.Width, img.Height))
		For c As Integer = 0 To img.Width - 1
			For r As Integer = 0 To img.Height - 1
				If img.GetPixel(c, r).ToArgb = Color.FromArgb(0, 192, 192).ToArgb Then
					Cursor.Position = New Point(c, r)
					Return
				End If
			Next
			Dim newMousePosition As New System.Drawing.Point
			newMousePosition.X = c
			System.Windows.Forms.Cursor.Position = newMousePosition
  Next
	End Sub


This here looks like it can help me: http://codefinds.blo...c-vbscript.html

This post has been edited by JohnorSky: 20 October 2009 - 10:23 AM

Was This Post Helpful? 0
  • +
  • -

#7 MacAnimeGirl  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 282
  • Joined: 30-September 08

Re: Tryting to figure this out...

Posted 20 October 2009 - 10:22 AM

http://forums.asp.net/t/1243847.aspx

Try that.
Was This Post Helpful? 0
  • +
  • -

#8 JohnorSky  Icon User is offline

  • D.I.C Head

Reputation: -5
  • View blog
  • Posts: 137
  • Joined: 02-September 08

Re: Tryting to figure this out...

Posted 20 October 2009 - 10:24 AM

View PostMacAnimeGirl, on 20 Oct, 2009 - 09:22 AM, said:



That's probably all of the information I need lol.. Seems really easy ;-P

I'll give it a go and reply back with what I ended up using...

Thanx
Was This Post Helpful? 0
  • +
  • -

#9 MacAnimeGirl  Icon User is offline

  • D.I.C Regular

Reputation: 8
  • View blog
  • Posts: 282
  • Joined: 30-September 08

Re: Tryting to figure this out...

Posted 20 October 2009 - 10:31 AM

Sounds good.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1