can someone make me a program that finds all white in picture and outputs it to scree

andreww
02-16-2002, 05:32 AM
i need a program to select all white (255,255,255) from the picture

i tried making a program but didnt work at all

..i really need it!

ChiefRedBull
02-16-2002, 05:46 AM
'select' the white areas?!

You mean remove them to make the picture transparent?

andreww
02-16-2002, 05:56 AM
well what im doing is i have a map..with white borders spacing each country

i want to make them a greenish colour, so it looks better

i want a program that scans for all white 255,255,255 on the picture and output it to the screen so i can take a screen shot and paste it into an image editor and turn them green,
i also got to put the borders onto a proper graphical map, as the one that i have now is made up of colours, i got another one with proper grass textures etc that doesnt have the borders on it

ChiefRedBull
02-16-2002, 06:33 AM
You want to take a screenshot and edit the map right? So what do you need VB for? Just press the PrintScrn button, and a shot of the screen is copied to the clipboard.

Of course you could just change the values in the picturebox. Scan each pixel in the image, check to see if its white, and change it if it is.
Look at GetPixel and SetPixel.

andreww
02-16-2002, 06:44 AM
i need vb as the paint shot pro that i am using doesnt have any features to change all the white colour to a green

i tried the getpixel method..i somehow stuffed it and got really ****ed off

ChiefRedBull
02-16-2002, 06:57 AM
okay....

What did you try for the API method?

Something like this?
Place API declarations here

Public Sub ChangeColor(picBox As PictureBox)
Dim i As Integer, j As Integer
picBox.ScaleMode = vbPixels
picBox.AutoRedraw = True

For i = 0 To picBox.ScaleHeight
For j = 0 To picBox.ScaleWidth
col = GetPixel (picBox.hDC, i, j)
col = col Xor 255
SetPixel picBox.hDC, i, j
Next j
Next i
End Sub
Untested...

andreww
02-16-2002, 07:02 AM
ah dont worry i found out why i didnt work

i didnt have the screen that i was copying off visible......

i have asked a question in the other post..recently next to this one...

about get pixel can u have a look at that

ChiefRedBull
02-16-2002, 07:06 AM
You shouldn't need to have the picture visible. GetPixel works on memory DCs hich are never 'visible' on the screen.

Yeh i read your other question, didn't really understand though, I haven't been following that thread.

andreww
02-16-2002, 07:18 AM
here ill post an example of what i mean

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum