i want to use a view to read the pixels from the screen

now if i use bmap_to_format i got 4 fps on a 640*480 on window mode
if i dont use bmap_to_format the game crash

has sombody a idee doesnt matter what maby i get set om idee's from it

ow and i dont want to change the wait(n);

Code:

function camera_scan()
{
	VIEW* cam1;
	cam1 = view_create(0);
	set(cam1,VISIBLE);
	
	
	var x = screen_size.x;
	var y = screen_size.y;
	var format = 565;
	
	
	BMAP* render_bmp;
	render_bmp = bmap_createblack(x,y,14);
	
	cam1.bmap = render_bmp;
	cam1.size_x = x;
	cam1.size_y = y;
	
	reset(camera,VISIBLE);
	
	PANEL* pan1;
	pan1 = pan_create("flags = VISIBLE;",1);
	pan1.bmap = render_bmp;
	
	var pixel;
	
	
	
	while(1)
	{
		proc_mode = PROC_LATE;
		vec_set(cam1.x,camera.x);
		vec_set(cam1.pan,camera.pan);
		
		
		 
		cam1.bmap = NULL;
		render_bmp = bmap_to_format(render_bmp,format);// is realy slow
		
		format = bmap_lock(render_bmp,565);
		debuga[0] = format;
		pixel = pixel_for_bmap(render_bmp,10,10);// i want to search and the screen and then save it in a array
		bmap_unlock(render_bmp);
		cam1.bmap = render_bmp;
		
		wait(1);
	}
}



Last edited by flits; 11/17/08 18:00.

"empty"