Resizing an Image inside a RichTextCtrl

Hi everyone,
what is the recommended way to rescale an image after it’s been added to a RichTextCtrl?
I’ve tried

imageBlock.GetImage().Rescale(neww, newh)
imageBlock.GetBuffer().Invalidate()

and while the text that surrounds the image does takes notice of the change and “re-layouts”, the image itself stays the same.
(What I’m trying to do is extending the wx.RichTextCtrl demo to allow adding images and then resize them)

Glancing at the C++ code it looks like the wxRichTextImage class caches the wxBitmap it creates from the wxImage. So calling its ResetImageCache() method might take care of your problem.

It looks like that method was added in wxPython 2.9.2, sadly I’m not quite there yet (long story).
Fortunately I’ve managed to find a workaround (calculate insertion point of the image, write a new resized image, delete the old one, invalidate the buffer) :slight_smile:
Thanks for your time! :slight_smile: