I have loaded a image(gif, jpg,..) of Dimension 800*600 into a bitmap. I want to resize the image into the dimension 500*400.
Thanks.
stretch_blit and stretch_sprite ?
to resize it you must create a new bitmap of the appropriate size:
BITMAP *a,*b; a = load_bitmap("jj.bmp",NULL); b = create_bitmap(500,400); stretch_blit(a, b, 0, 0, a->w, a->h, 0, 0, b->w, dest_b->h); destroy_bitmap(a); //free the memory, you can use b from now on
I think these functions will display the resized image on the destination image.
Will it store it in the destination image.
I want to make it clear.
I have a bitmap of size 800* 600 and want the same image reduced to 500*400. Then I'll use the resulted image further more.
Thanks FMC U cleared it.
FMC's suggestion will store it in the destination image. It creates a new image, stretches your current image and saves that result in the 500x400 bitmap, so you have your full-sized image and your new smaller image in two separate memory locations.
Display and store, in this case, mean the same thing. You cannot display an image without storing it. Even blitting to the screen results in the bitmap being stored in the primary video bitmap.
How baddly does stretching distort the bitmap?
Thanks one and all.
I could make a fine stretching.