
Using Visual Basic 2008, how do you make your mouse pointer move to a specific color on the screen?
I want to know how to make a program in Visual Basic 2008 that moves your mouse pointer to a specific location on the screen, chosen by the pixel color of that location.
Where does the “Grapes.jpg” come in and what is it?
Use the GetPixel api to get the color of a pixel (might be different if using .NET do a search in MSDN)
Dim myBitmap As New Bitmap(“Grapes.jpg”)
Dim pixelColor As Color = myBitmap.GetPixel(50, 50)
then test to see if that pixel is the color you are looking for and if it is use the same coordinates used in GetPixel to set the cursor position
/* Non .net way */
Dim retval As Long ‘ return value
retval = SetCursorPos(50, 50)
/* End non .net way */
/* .NET Way */
Me.Cursor = New Cursor(Cursor.Current.Handle)
Cursor.Position = New Point(50, 50)
Cursor.Clip = New Rectangle(Me.Location, Me.Size)
/* .NET Way */
GetPixel, SetCursorPos, and Point constructor use X coord as its first argument and Y coord as its second
Grapes.jpg is just an example, you would need to get some way of getting the screen data to do what you want, but not sure exactly how
Sony Flexible Full Color Paper Screen
|
|
Thermos Nissan 34-Ounce Vacuum Insulated Stainless-Steel Gourmet Coffee Press $25.99 Stainless steel coffee press… |
|
|
EatSmart Precision Pro – Multifunction Digital Kitchen Scale w/ Extra Large LCD and 11 Lb. Capacity The EatSmart Precision Pro Digital Kitchen Scale is a versatile multifunction home appliance. Designed to be highly accurate and aesthetically pleasing, the Precision Pro is manufactured to the highest quality specifications. Weigh items up to 11 lbs quickly and accurately, with results displayed in four different units: grams / ounces / pounds / kilograms. For cooks – Weigh food items directly on… |
|
|
Instapark® 1.5 Premium Quality Tobacco Herb Grinder, Color Black $14.99 Made of strong anodized aircraft-grade aluminum alloy and manufactured with CNC (Computer Numerical Control) machinery, the Instapark herb grinder is an invaluable & indispensable tool to own when it comes to grinding your spices, herbs, tobacco and etc. Featuring a 4-chamber design, the top and bottom grinder are held together by strong neodymium magnet to ensure a tight & secure closure. In be… |
|
|
The Sandlot $6.32 Whimsical family comedy set in the summer of 1962 in which a nerdy boy decides to join the neighborhood kids in playing baseball at a decrepit lot. When the boy borrows his stepfather’s prize baseball–signed by no less than Babe Ruth–and it lands in a yard inhabited by the mysterious “Beast,” it must be retrieved at any cost. Tom Guiry, Karen Allen, and James Earl Jones star. 101 min. Widescreen… |
|
|
The Blues Brothers (Widescreen 25th Anniversary Edition) $7.17 Bringing their “SNL” characters to the big screen, John Belushi and Dan Aykroyd are Jake and Elwood Blues, two ex-con, music-loving brothers out to reunite their old band so they can raise money to save the Chicago orphanage where they grew up. Filled with wild car chases and songs from such guest stars as James Brown, Cab Calloway, Ray Charles, and Aretha Franklin, John Landis’ high-octane comedy… |
|
|
Baby Signing Time Volume 1 DVD $14.00 BABY SIGNING TIME VOL 1 – DVD Movie… |
|
|
First Alert CO615 Carbon Monoxide Plug-In Alarm with Battery Backup and Digital Display $27.95 Carbon monoxide (CO) is the leading cause of accidental poisoning deaths in America, yet many people don’t know they are suffering from CO poisoning until its too late. Since symptoms of CO poisoning are like the flu, you might not even know you’re in danger at first. That’s why a carbon monoxide alarm is an excellent way to protect your family. It can detect the CO you can’t see, smell or taste i… |
|
|
Black & Decker TLD100 Thermal Leak Detector $23.99 The Black & Decker thermal leak detector helps you increase the efficiency of your home’s insulation by finding leaky areas that can lead to higher heating and cooling bills. You’ll instantly identify problem areas around drafty windows and doors, and uncover hidden leaks and insulation “soft spots” around your home. Check windows, ducts, and walls with the thermal reference light that indicates h… |

No comments yet.
Leave a comment