Page 1 of 1

SRichViewEdit paste image (not bitmap)

Posted: Tue Jul 09, 2013 10:10 pm
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]

Posted: Wed Jul 10, 2013 5:06 am
by Sergey Tkachenko
Which image, for example?

image small size in paste

Posted: Wed Jul 10, 2013 11:48 am
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)?

image reduction

Posted: Wed Jul 10, 2013 2:23 pm
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?

Posted: Wed Jul 10, 2013 3:57 pm
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.

image metafile in past

Posted: Wed Jul 10, 2013 4:36 pm
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 ?

Posted: Wed Jul 10, 2013 5:10 pm
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.

Posted: Wed Jul 10, 2013 5:31 pm
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.