Night - Day Filter

BlitzPlus Forums/BlitzPlus Programming/Night - Day Filter

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Okay I don't get how it all works togeather can you rewrite the code to use the Red, Blue, Green thing
NeverMind thanks it worked :P

is there way to make 0 full bright and 1 full darkness in my code..??

Function FB_DarkenImage ( image, d#=1 )

	For ix = 0 To ImageWidth( image ) - 1
		For iy = 0 To ImageHeight( image ) - 1
			Local rbgc = ReadPixel( ix, iy, ImageBuffer(image) )
			Alpha% = (rbgc And $FF000000) Shr 24 
			Red% = (rbgc And $00FF0000) Shr 16 
			Green% = (rbgc And $0000FF00) Shr 8 
			Blue% = rbgc And $000000FF
			Red = Red * d#
			Green = Green * d#
			Blue = Blue * d#
			rbgc = (Alpha Shl 24) + (Red Shl 16) + (Green Shl 8) + Blue 
			If rbgc = $FFFF00FF
				WritePixel ix,iy,($0),ImageBuffer(image)		
			Else
				WritePixel ix,iy,(rbgc), ImageBuffer(image)
			EndIf
		Next
	Next
	
	Return image

End Function 


[edit]
How would I also lighten that image using this code basicly im trying to make a code depending on % the images brightness will be changed :) can you see what needs to be added