Here im scaling to 285 x 280 but is it possible to scale to 285 x (whatever keeps the height proportions of the intial image when scaled down to 285px wide)
Thanks for any help with this (especially examples :))
Here im scaling to 285 x 280 but is it possible to scale to 285 x (whatever keeps the height proportions of the intial image when scaled down to 285px wide)
Thanks for any help with this (especially examples :))
Hi, can anyone help with keeping the x or y proportions of an image when scaling e.g
pic = wx.Image(self.filename, wx.BITMAP_TYPE_ANY).Scale(285, 280)
self.pickedImage = wx.BitmapFromImage(pic, -1)
self.staticBitmap1.SetBitmap(self.pickedImage )
self.staticBitmap1.Show (True)
A proportional resize is a very simple math problem, you just want to adjust the alternate dimension by the same factor that you are adjusting the known dimension. In other words, given this algebraic equation:
newWidth/oldWidth = newHeight/oldHeight
plug in the values that you know and solve for the new dimension that you don't know. Like this: