image in trichviewedit

General TRichView support forum. Please post your questions here
Post Reply
krctech
Posts: 7
Joined: Tue Jun 03, 2008 4:57 am
Location: San Diego, CA US

image in trichviewedit

Post by krctech »

I have an image that has a resolution of 600 dpi (actually I have one that has even greater resolution). If I scale this down to display resolution (72 or 96 dpi), it looks bad when printed.

If I leave the resolution at 600 and manually resize it in the control at runtime, it looks okay when printed. If I don't resize it, if of course is very large when displayed or printed.

My question is how to resize this in code, if possible, so that it displays and prints so it looks fine.

FYI: right now, i'm simply loading from a file (PNG) and adding it to a table:

Code: Select all

logo.LoadFromFile(logoFilePath);
table.Cells[0,0].AddPictureEx('logo', logo, 1, rvvaLeft);
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Code: Select all

with table.Cells[0,0] do begin
  AddPictureEx('logo', logo, 1, rvvaLeft); 
  SetItemExtraIntProperty(ItemCount-1, rvepImageWidth,  Round(logo.Width*96/600)); 
  SetItemExtraIntProperty(ItemCount-1, rvepImageHeight,  Round(logo.Height*96/600)); 
end;
Post Reply