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

A test image:


full size 1920x1080

I want to copy the red rectangle to point 0,0.

I understood how the gfx_blit works.. But still I think I am not drawing correctly to the buffer because it flickers:
Code:
input_info(0, w, h);
gfx_dest = mybuf = gfx_img_alloc(w,h);
gfx_blit(0,1,0,0,242,137,1200,540,242,137);
gfx_dest = -1;
gfx_blit(mybuf, 1);
gfx_img_free(mybuf);
Edit: this works! :
Code:
input_info(0, w, h);
mybuf = gfx_img_alloc(w,h);
gfx_dest = mybuf;
gfx_blit(0,1);
gfx_blit(0,1,0,0,242,137,1200,540,242,137);
gfx_dest = -1;
gfx_blit(mybuf, 1);
gfx_img_free(mybuf);
Is it the correct way to do it?
amagalma is offline   Reply With Quote