Sizing Image When Pasted
Posted: Mon Aug 23, 2021 8:25 pm
Hi Sergey,
I'd like to size an image when I paste it into my rve. My SetImageAspect works fine when I insert an image from an open dialog, or when I drop it in (I put my code into after ole drop for that).
I'm using this right now:
I know that rvePaste runs as I put a breakpoint into it on the "if rve.CurItemStyle = rvsPicture then" line. But it never seems to know that the photo I pasted is the current item. Is there a way to do that? Or some other way to get the item number of what was pasted in?
For now I can run it from a menu item which works fine, but be more convenient if I can get it to work when pasted.
Thanks Sergey
Stan
I'd like to size an image when I paste it into my rve. My SetImageAspect works fine when I insert an image from an open dialog, or when I drop it in (I put my code into after ole drop for that).
I'm using this right now:
Code: Select all
procedure TForm1.rvePaste(Sender: TCustomRichViewEdit; var DoDefault: Boolean);
begin
if rve.CurItemStyle = rvsPicture then
begin
rve.BeginUpdate;
SetImageAspect(rve);
rve.EndUpdate;
end;
end;
For now I can run it from a menu item which works fine, but be more convenient if I can get it to work when pasted.
Thanks Sergey
Stan