How to change an images size in c++, SDL -


how can change images size in code below:

const int xhome = 10, yhome = 10; const int whome = 50, hhome = 50; . . .  sdl_surface* image = sdl_loadbmp(address);  sdl_rect destrect;  destrect.x = whome * x;  destrect.y = hhome * y;  destrect.w = whome; destrect.h = hhome;  sdl_blitsurface(image, null, mainscreen, &destrect);  sdl_freesurface(image); 

when put image in mainscreen sdl_surface, it's bigger 50*50. possible resize image? thank you.


this happens when set whome , hhome, 50*50.
since have 5 reputation, can't post images. see image please click here.

but when set them original images size, see:
here

according sdl_blitsurface documentation:

only position used in dstrect (the width , height ignored).

i highly recommend switching sdl 2 many reasons (hardware acceleration being big one); task become trivial texture , sdl_rendercopy. if you're somehow stuck using sdl 1, can either scaling surfaces manually, or use library sdl_gfx, has custom blit functions.


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -