I wrote an activex control for showing images in richedit.What i want is the control's size changes as the image in it changes, but the control's size seems to be fixed, i've no idea how to get it.Is there way to reach that?
Asked
Active
Viewed 583 times
0
-
I solved it. When image loaded,got image's width and height,then added codes like below: AtlPixelToHiMetric(&sizel, &m_sizeExtent); m_sizeNatural = m_sizeExtent; I am a starter about activex, even didn't know how activex worked. think it's a silly question for old hands. – KnowNothing Aug 28 '13 at 01:41
1 Answers
0
Change the size of your ActiveX control's window with SetWindowPos then call IOleInPlaceSite::OnPosRectChange on your site object.
[EDITED] Apparently, you could perform the above upon EN_REQUESTRESIZE notification from RichEdit. EN_OBJECTPOSITIONS also looks relevant. Try both and share the result with us.

noseratio
- 59,932
- 34
- 208
- 486