Change image and image aspect ratio
Posted: Fri Dec 06, 2019 2:37 pm
Hi,
I am a new TRichViewEdit user and I am still struggling to learn how to use it properly.
The first thing I have tried to do, is to replace all images with Tag="Signature" in TRichViewEdit with new ones.
I need this, because we will use templates of documents that will include dummy images of signatures.
Those images will be later replaced with actual customers signatures images from a sign pad.
They can be differentiated form other images by the Tag="Signature".
I hope I am using the right aproach...
This is how I did it.
The next thing I am trying to do is to set a certain image aspect ratio, but I can't find any information on how to do it.
Why I need this...
The templates I have mentioned above can be modified by the user. Text and other images can be added, and dummy signature images can be moved and stretched.
So, I have to guarantee that the dummy signatures images (not all images) will always keep the aspect I define.
That aspect ratio must be the same as of those images I get from the sign pad, otherwise the customers signatures will be deformed.
Thanks for help.
Regards,
I am a new TRichViewEdit user and I am still struggling to learn how to use it properly.
The first thing I have tried to do, is to replace all images with Tag="Signature" in TRichViewEdit with new ones.
I need this, because we will use templates of documents that will include dummy images of signatures.
Those images will be later replaced with actual customers signatures images from a sign pad.
They can be differentiated form other images by the Tag="Signature".
I hope I am using the right aproach...
This is how I did it.
Code: Select all
procedure TForm3.Button2Click(Sender: TObject);
var i, itemNo : Integer;
Item : TCustomRVItemInfo;
sTag : String;
begin
itemNo := RichViewEdit1.CurItemNo;
RichViewEdit1.SetItemTag(itemNo,'Signature');
for i := RichViewEdit1.ItemCount - 1 downto 0 do
begin
Item := RichViewEdit1.GetItem(i);
sTag := TRVGraphicItemInfo(Item).Tag;
if ((Item is TRVGraphicItemInfo) or (Item is TRVBulletItemInfo)) and
( sTag = 'Signature' ) then
begin
TRVGraphicItemInfo(Item).Image.LoadFromFile('C:\Users\Razvijalec\Desktop\audax_logo.jpg');
end;
end;
RichViewEdit1.Format;
end;
Why I need this...
The templates I have mentioned above can be modified by the user. Text and other images can be added, and dummy signature images can be moved and stretched.
So, I have to guarantee that the dummy signatures images (not all images) will always keep the aspect I define.
That aspect ratio must be the same as of those images I get from the sign pad, otherwise the customers signatures will be deformed.
Thanks for help.
Regards,