Page 1 of 1

Drag marks shifted after export to image file or clipboard

Posted: Tue May 09, 2006 9:01 am
by 9336299
:arrow: After user adds drag marks in a chart and chart is exported;
Drag marks are vertically shifted in exported image file (occurs for BMP, JPG, GIF and PCX) and clipboard.

:arrow: occurs with TeeChartPro v7.07 and older, with Delphi 6 and WinXP

:?: Do you know a solution in order to obtain the same position for drag marks in exported image as in chart (WYSIWYG :))?

Thanks

Posted: Tue May 09, 2006 9:30 am
by narcis
Hi SiA,

It works fine for me here using v7.07 and the code below in a chart with a TDragMarksTool. Can you please if this works for you?

Code: Select all

uses TeeBmpOptions, TeeJPEG, TeExport, TeeGIF, GIFImage, TeePNG;

procedure TForm1.Button1Click(Sender: TObject);
var tmpGIF : TGIFImage;
begin
  //BMP
  TeeSaveToBitmap( Chart1, 'myBMPChart.bmp', Chart1.ChartBounds );
  //Chart1.SaveToBitmapFile('myBMPChart.jpg');

  //JPG
  TeeSaveToJPEG( Chart1, 'myJPEGChart.jpg', Chart1.Width, Chart1.Height );

  //GIF
  tmpGIF:=TGIFImage.Create;
  With tmpGIF do
  begin
    Compression:=gcLZW;
    DitherMode:=dmStucki;
    ColorReduction:=rmQuantizeWindows;
    Assign(Chart1.TeeCreateBitmap(Chart1.Color,Rect(0,0,Chart1.Width,Chart1.Height)));
    SaveToFile('myGIFChart.gif');
  end;

  //PNG
  TeeSaveToPNG( Chart1, 'myPNGChart.png', Chart1.Width, Chart1.Height );

  //Clipboard
  //Chart1.CopyToClipboardMetafile(True);  
	Chart1.CopyToClipboardBitmap;
end;