Page 1 of 1

image in trichviewedit

Posted: Wed Dec 10, 2014 9:46 pm
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);

Posted: Wed Dec 10, 2014 11:35 pm
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;