I've written a simple piece of code to go through and analyse each pixel, for colour, in a picture.
The picture is loaded into my form with the use of a picturebox. The picture is quite complex, but is only made of black and white colours.
When the pixel colour doesn't equal white (16777215) I use the x,y co-ordinates of that pixel and write them to a file.
I then use this file to re-generate the picture in one of our companies in-house applications.
Here is the code that determines the colour of every pixel:
For i = 0 To Picture1.Width -1 Step 1
For j = 0 To Picture1.Height -1 Step 1
Colour = Picture1.Point(i, j)
If Colour <> 16777215 Then f.writeline (" RectAbs " & i & "," & j & " 1,1")
The problem is that my picture is way to big to show it all at once on screen. Because my picturebox is smaller than the size of the picture, when analysing a pixel outside of the picturebox frame i get an colour that doesn't relate to what the picture should be showing.
Can anyone suggest a better way of going though each and every pixel of my picture, without having to actually show the whole picture on screen? If there are better ways of doing this that include not loading the picture into my program, then the picture was originally in a HPGL format which i converted in TIFF. I guess i could convert it into another format if it makes things easier.
Any sample/snipets of code would be greatly appreciated in getting me started.
Thanks very much.