ThePentiumGuy Posted October 2, 2003 Posted October 2, 2003 hi how would i check weather a user clicked the Lime-Green area of a bitmap?(regardless of what the bitmap is.. thats why i want to do that) thanks, -Pentium- Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
aewarnick Posted October 3, 2003 Posted October 3, 2003 Use the GetPixel method of the Bitmap. Quote C#
ThePentiumGuy Posted October 3, 2003 Author Posted October 3, 2003 yo, sry but there is no getpixel :( this is what i have: Private Sub mainform_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseUp Dim bmpc As Bitmap() bmpc.getpixel() <-- -doesnt exist.. not in the list End Sub sry, but can u pleasee gimme specic instructions Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
PhilH Posted October 3, 2003 Posted October 3, 2003 You could try something like: Dim bmpc As New Bitmap("C:\bmpc.bmp") Dim pixelColor As Color = bmpc.GetPixel(e.X, e.Y) If pixelColor.G = 255 Then 'or whatever your value is 'etc Quote
aewarnick Posted October 3, 2003 Posted October 3, 2003 Bmp.GetPixel(10,10); It is in my list. Put 10,10 in the parenthesis and see if it compiles. Quote C#
ThePentiumGuy Posted October 3, 2003 Author Posted October 3, 2003 oh i see 0_o, i needed to type in New bitmap, instead of Bitmap thans PhilH: Your solution worked! Thanks a Million! Quote My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!) vbprogramming.8k.com My Project (Need VB.NET Programmers) http://workspaces.gotdotnet.com/ResolutionRPG
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.