'imageprocessorMod1 'Produces a 'screened' ouput with dot-size controlled by brightness. 'The effect is like a blow-up of a small part of a screened nespeper photo. 'Rasterbater' is my on-line model I was emiulating. See http://homokaasu.org/rasterbator/ 'I intend to modify so it uses the saved array of brightness data to create and save 'the rasterbated image as several tiles, to print each 'on a whole sheet for a large poster. 'To-dos include file selectors for load/save. JPG load/save via dll. Rescale. Print tiles. s =200 'Image width and height, pixels 0 --> 199 each way dim i( s, s) 'array to save brightness values nomainwin graphicbox #main.g1, 10, 10, 200, 200 graphicbox #main.g2, 10, 220, 200, 200 graphicbox #main.g3, 10, 430, 200, 200 graphicbox #main.g4, 10, 640, 200, 200 graphicbox #main.g5, 220, 10, 800, 780 UpperLeftX = 1 UpperLeftY = 1 WindowWidth = 1060 WindowHeight = 850 open "Image processorMod1- colour separation & rasterbate output." for window as #main hW = hwnd( #main.g1) open "user32" for DLL as #user callDLL #user, "GetDC", hW as long, hDC as long open "WINMM.DLL" for DLL as #mm #main, "trapclose [quit]" loadbmp "image", "orig.bmp" 'This should be 200 by 200 pixels bitmap 'Need to make this a file-selector rather than fixed. 'Would then need to scale image.... #main.g1, "down ; drawbmp image 0 0" #main.g1, "flush" #main.g2, "down ; fill black" #main.g3, "down ; fill black" #main.g4, "down ; fill black" #main.g5, "down ; fill white" ' ; rule "; _R2_NOTXORPEN #main.g5, "vertscrollbar off" w =4 for x =0 to s -1 step w for y =0 to s -1 step w p =getPixel( hDC, x, y) if p <1 then p =1 B =int( p / (256 *256)) G =int(( p - B *256 *256) / 256) R =int( p - B *256 *256 - G *256) br =3 *(0.299 *R + 0.587 *G + 0.114 *B) i( x, y) =br #main.g2, "down ; backcolor "; R; " 0 0 ; color " ; R; " 0 0 ; place "_ ; x; " "; y; " ; circlefilled "; " "; 0.5+w/2 #main.g3, "down ; backcolor 0 "; G; " 0 ; color 0 "; G; " 0 ; place "_ ; x; " "; y; " ; circlefilled "; " "; 0.5+w/2 #main.g4, "down ; backcolor 0 0 "; B; " ; color 0 0 "; B; " ; place "_ ; x; " "; y; " ; circlefilled "; " "; 0.5+w/2 'Move to a later routine to recreate a series of save rasterbated bitmap tiles #main.g5, "down ; backcolor 0 0 0 ; color 0 0 0 ; place "_ ; 4 +4*x; " "; 4 +4*y; " ; circlefilled "; " "; 1 +br /80 scan next y next x #main.g1, "flush" #main.g2, "flush" #main.g3, "flush" #main.g4, "flush" #main.g5, "flush" #main.g5, "getbmp rast 1 1 799 779" bmpsave "rast", "rast.bmp" notice "Image saved!" + chr$(13) + "Click to quit" goto [quit] 'getPixelCode by Alyce Watson Function getPixel( hDC, x, y) Open "gdi32" for DLL as #gdi CallDLL #gdi, "GetPixel", hDC as long, x as long, y as long, getPixel as long Close #gdi End Function [quit] close #main close #user close #mm end