i am currently working on a program which loads field maps to a picture box and performs a model of patch spraying operation. basically a tractor and sprayer drives around the field and by recognising the colour of a pixel it decides whether to spray or not. the maps are in black and white. black for weed white for non weed. i am trying to develop some code which steps around the edge pixels of the field and changes their colour to show that they have been processed. i am very new to programming and any help in this process would be greatly appreciated. thank you
The "Point" command will allow you to read a pixel.
The "PSet" command will allow you to update a pixel.
I'd recommend setting up a subroutine you could call using X and Y parameters to reduce the amount of coding and debugging. Something like this:
' clockwise from upper left
Public Sub ScanPoints(tmpXFrom as long, tmpXTo as long,
tmpXStep as long, tmpYFrom as long,
tmpYTo as long, tmpYStep as long)
' Left/right or Up/down
If tmpXStep = 0 then
for lclIndex=tmpYFrom to tmpYTo step tmpYStep
for lclIndex=tmpXFrom to tmpXTo step tmpXStep
This isn't elegant or fast, but should put you in the ballpark.
If you need more information, here are some books that go into graphics:
Instant Visual Basic Animation
The Revolutionary Guide to Bitmapped Graphics
The Visual Basic Programmers Guide to the Win32 API