add to top:
Code:
#include <windows.h>
long WINAPI ShellExecute(long hwnd ,long lpOperation ,long lpFile ,long lpParameters ,long lpDirectory ,long nShowCmd);



call:
Code:
file_for_screen("printfile.jpg",0);
wait(-2);//it could be better if you check file exists or not instead of waiting 2 secs
ShellExecute(0,"print","printfile0.jpg","","",1);



this will show user a print dialog where they can choose printer, paper etc. and it will print your file.

here is a complete test script. press space to trigger printing(press only once.)

Code:
#include <acknex.h>
#include <default.c>
#include <windows.h>
long WINAPI ShellExecute(long hwnd ,long lpOperation ,long lpFile ,long lpParameters ,long lpDirectory ,long nShowCmd);

TEXT* test = {
	red = 0;
	green = 0;
	blue = 0;
	font = "Arial#18b";
	string = "Print from the engine!";
	flags = SHOW | CENTER_X;
	pos_x = 100;
	pos_y = 20;
}

void print_screen(){
	file_for_screen("printfile.jpg",0);
	wait(-2);
	ShellExecute(0,"print","printfile0.jpg","","",1);
}
void main(){
	vec_set(screen_color,vector(255,255,255));
	video_set(200,60,0,0);
	on_space = print_screen;
}



Last edited by Quadraxas; 03/29/10 22:55.

3333333333