SRichViewEdit paste image (not bitmap)

General TRichView support forum. Please post your questions here
Post Reply
RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

SRichViewEdit paste image (not bitmap)

Post by RobertoVG »

When I paste the image (not bitmap) in SRichViewEdit1 (5.1) it decreases considerably in size (in the example richview action text)

I've tried changing compile using pngimage correctly, but also did not work.

any idea about this occurrence?[/img]
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Which image, for example?
RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

image small size in paste

Post by RobertoVG »

Load microsoft word, insert an object forms and get a arrow. Then paste it into the editor richview-action test I mentioned. If you type any text after the image is reduced substantially. Menu (action
special collar) certifies that this is the type metafile.

I tested with other pictures of other editors that generate metafile, when pasting in editor richview mentioned, the same thing happens.

At first I could not identify (I have no experience in TRichView) a property in Srichview or action that could keep the image. If you confirm this, would tell me how can I code in force this type of image to be glued to stay with the same size (default)?
RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

image reduction

Post by RobertoVG »

I discovered (as the code below) that comment the lines below the image becomes glued normally without suffering the reduction
caused (incorrectly?) By methods SetExtraIntProperty

Unit RVEdit ...

...function TCustomRichViewEdit.PasteMetafile
...
w := wmf.Width;
h := wmf.Height;
...
...InsertPicture(s,wmf,DefaultPictureVAlign);
if (GetCurrentItem is TRVGraphicItemInfo) and
(TRVGraphicItemInfo(GetCurrentItem).Image = wmf) then begin
// GetCurrentItem.SetExtraIntProperty(rvepImageWidth, w);
// GetCurrentItem.SetExtraIntProperty(rvepImageHeight, h);
end;

What you consider Sergey?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This is a bug, this code does not take into account that sizes may be measured in twips instead of pixels.
Actually, I think this code may be removed. I'll remove it in the next update.
RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

image metafile in past

Post by RobertoVG »

if you just remove the named code , the menu (action) option format-> object properties will not contain parameters like width and height of the image metafile. I think that you must check the propertie SetExtraIntProperty and verity what had happened with the relation between richviewactions.

I explained this way because when you use scalerichview (edit) with "richviewactions" in the past action the bug occur. In other way the bug doen´t occur (with no richviewactions ).


See the project ...\TRichView\ScaleRichView\Demos\RVDemos\Editors\Editor 1 where the bug doesn´t occur because doesn´t use "richviewaction".

What do you think ?
RobertoVG
Posts: 40
Joined: Fri Mar 15, 2013 8:35 pm

Post by RobertoVG »

Complementing the previous content, I believe that making the following adjustments prove that this is not a bug:

In the project TRichView\ScaleRichView\Demos\ActionTest if you disable with comment below in oncreateform...

// measuring units
// RVA_ConvertToTwips(srvActionsResource);
// RVAControlPanel1.UnitsProgram := rvstuTwips;
// SRichViewEdit1.ConvertToTwips;
// cmbUnits.ItemIndex := ord(SRichViewEdit1.UnitsProgram);
// RVAControlPanel1.UnitsDisplay := SRichViewEdit1.UnitsProgram;

the bug does not ocurr and the object propertie work fine with richviewactions.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

The bug occurs if measure units are twips.

Yes, if you remove this code, the menu (action) option format-> object properties will not contain parameters like width and height of the image metafile. But it is not necessary - they are necessary only if the image is resized.
Post Reply