//panel that will hold the bmap
PANEL* testPan {};
//the function that does your task
void shot()
{
//Create a bmap at runtime
BMAP* testB=bmap_createblack(screen_size.x,screen_size.y,32);
//Get the screenshot and
bmap_for_screen(testB,0,1);
//use the just created bmap as the 'bmap' source
testPan.bmap=testB;
//Make the panel visible
set(testPan,SHOW);
//while the scale size is greater than 0.25 (25%)
while(testPan.size_x > 0.25){wait(1);//always wait 1 frame each cycle
//change to a higher number 0.5 for a faster scale time
testPan.size_x -= 0.05 * time_step;
// Keep the panel aligned while scaling
testPan.pos_x = (screen_size.x - testPan.size_x)/4;
testPan.pos_y = (screen_size.y - testPan.size_y)/4;
}
}
//In the function main
function main(){
//infinitely
while(1){wait(1);
if(key_x) shot();//update the corner image with the x key
}
}