However, we're having issues that the resolution of the bitmaps are based on their currently rendered size on screen. So people on low resolution desktops, or who happen to not be running the app maximized end up with quite low resolution images in the generated Word document.
We'd like to be able to set the resolution before doing the CopyToClipboardBitmap. Is there anyway to do this?
Note, we've tried using CopyToClipboardMetafile (with both true and false as the argument) and that seems to have similar issues in that the size of the image is based on the rendered size on screen. This results in the text for the axis, labels, etc. being overly large when made larger within the document. So we're back to wanting to be able to specify the render size that the CopyToClipboardBitmap / CopyToClipboardMetafile / SaveToBitmapFile / SaveToMetafile / SaveToMetafileEnh is based upon.
Code: Select all
procedure copyToClipboard(const aChart: TChart);
var
guid: TGUID;
str: String;
begin
SysUtils.CreateGUID(guid);
str := StringUtils.ToStr(guid);
aChart.CopyToClipboardBitmap();
aChart.SaveToBitmapFile('C:\temp\' + str + '.bmp'); // DEBUG
// aChart.CopyToClipboardMetafile(false);
aChart.SaveToMetafile('C:\temp\' + str + '.wmf'); // DEBUG
// aChart.CopyToClipboardMetafile(true);
aChart.SaveToMetafileEnh('C:\temp\' + str + '.emf'); // DEBUG
end;