How to rotate an bitmap / image
Phil <[email protected]> Mon, 5 Jul 2021 14:40:43 +1000
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <[email protected]> |
Thank you for reading this.
I have a jpeg image that I'd like to rotate about it's bottom centre
point. It would also be helpful if I could set it's initial position on
the panel at the same point rather that it's default upper left point.
Also, would it better to work with an image or a bitmap?
This what I've been experimenting with:
class ImageFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, title="Bitmap test")
#img = wx.Image("test.jpg", wx.BITMAP_TYPE_JPEG)
# if an image is the best option, how do I display it on the panel?
# "test.jpg", wx.BITMAP_TYPE_JPEG), ConvertToBitmap() ?
# if I do that then I'm still working with a bitmap, aren't I?
bmp = wx.Bitmap('test.jpg')
wx.StaticBitmap(self, -1, bmp, (20, 100))
# position the bitmap by it upper left corner at 20, 100
def rotate(angle):
# pivot the bitmap on it's bottom centre point
Any code snippets or advice will be greatly appreciated.
--
Regards,
Phil
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/a0f0a417-0ecb-03c5-f9bf-d0209ded0fe8%40gmail.com.