View Single Post
Old 05-27-2020, 10:39 AM   #3
amagalma
Human being with feelings
 
amagalma's Avatar
 
Join Date: Apr 2011
Posts: 2,199
Default

Thank you very much for helping me

So, is this the correct way?:
Code:
// Crop Image (curtains)
//@param1:x_pos 'Horiz Shift' 0 -1 1 0 0.01
//@param2:y_pos 'Vert Shift' 0 -1 1 0 0.01
//@param3:w_size 'Horizontal Curtains' 0 0 1 0.5 0.01
//@param4:h_size 'Vertical Curtains' 0 0 1 0.5 0.01

input_info(0, w, h);
gfx_dest = mybuf = gfx_img_alloc(w,h);
gfx_blit(0, 1, 0, 0, w, h, -x_pos*w, y_pos*h, w, h );
w_size != 0 ? (
  w_size = w*w_size/2;
  gfx_fillrect(0,0,w_size,h);
  gfx_fillrect(w-w_size,0,w_size,h);
);
h_size != 0 ? (
  h_size = h*h_size/2;
  gfx_fillrect(0,0,w,h_size);
  gfx_fillrect(0,h-h_size,w,h_size);
);
gfx_dest = -1;
gfx_blit(mybuf, 1);
gfx_img_free(mybuf);
amagalma is offline   Reply With Quote