![]() |
|
how to resize a bitmap image |
raja peter
Member #7,835
October 2006
|
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. luv, raja |
Frank Drebin
Member #2,987
December 2002
![]() |
FMC
Member #4,431
March 2004
![]() |
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
[FMC Studios] - [Caries Field] - [Ctris] - [Pman] - [Chess for allegroites] |
raja peter
Member #7,835
October 2006
|
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. luv, raja |
TeamTerradactyl
Member #7,733
September 2006
![]() |
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.
|
Erkle
Member #3,493
May 2003
![]() |
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.
If the writing above has offended you, you've read it wrong.....fool. |
julian boolean
Member #7,941
November 2006
|
How baddly does stretching distort the bitmap? |
raja peter
Member #7,835
October 2006
|
Thanks one and all. I could make a fine stretching. luv, raja |
|