01-11-2012, 04:57 AM
I use this to increase graphic sizes for a zoomed effect in my CharGen project
Okay.... it may be a mess. The thing is the temp_bmp.stretch_blt(rect, bitmapped, rect2) routine.
rect is the rectangle holding the size/shape of your original
rect2 is the rectangle of your shrunk/resized image
bitmapped is your file
and temp_bmp is your new one
Code:
def resize(bitmapped,flag)
if flag == true
temp_bmp = bitmapped.clone
rect = Rect.new(0, 0, temp_bmp.width, temp_bmp.height)
rect2 = Rect.new((temp_bmp.width/$game_zoom.chargen[1].to_i)*(($game_zoom.chargen[3].to_i)-1),
(temp_bmp.height/$game_zoom.chargen[2].to_i)*(($game_zoom.chargen[4].to_i)-1),
temp_bmp.width/$game_zoom.chargen[1].to_i,
temp_bmp.height/$game_zoom.chargen[2].to_i)
temp_bmp = Bitmap.new(temp_bmp.width, temp_bmp.height)
temp_bmp.stretch_blt(rect, bitmapped, rect2)
bitmapped = temp_bmp
end
return bitmapped
endrect is the rectangle holding the size/shape of your original
rect2 is the rectangle of your shrunk/resized image
bitmapped is your file
and temp_bmp is your new one

![[Image: QrnbKlx.jpg]](https://i.imgur.com/QrnbKlx.jpg)
![[Image: sGz1ErF.png]](https://i.imgur.com/sGz1ErF.png)
![[Image: liM4ikn.png]](https://i.imgur.com/liM4ikn.png)
![[Image: fdzKgZA.png]](https://i.imgur.com/fdzKgZA.png)
![[Image: sj0H81z.png]](https://i.imgur.com/sj0H81z.png)
![[Image: QL7oRau.png]](https://i.imgur.com/QL7oRau.png)
![[Image: uSqjY09.png]](https://i.imgur.com/uSqjY09.png)
![[Image: GAA3qE9.png]](https://i.imgur.com/GAA3qE9.png)
![[Image: 2Hmnx1G.png]](https://i.imgur.com/2Hmnx1G.png)
![[Image: BwtNdKw.png%5B]](https://i.imgur.com/BwtNdKw.png%5B)