Page 1 of 1

monitor resolution affects bmp output from chart control?

Posted: Wed Oct 06, 2004 11:30 pm
by 5889868
fv_dbChartControl.SaveToBitmapFile( strScratchFilename,
Rect( 0, 0, mv_nSavedChartWidth, mv_nSavedChartHeight ) );

When i save an image from a chart to a bmp file, some of the text information like x-axis lables towards the end and also the legend texts (although legend colors does show up) are missing from the bmp file. But when i increase the resolution and then output image to a file, it seem to have the right image with no missing text.

Is this a known issue and if so, is there a work around? Or is there a minimum resolution requirement?
note: we are on teechart V7.

Thanks,
- Suma

Posted: Thu Oct 07, 2004 6:15 pm
by 5889868
Also when i export it, i increase teh height and width of the image.
default values are set to:
uc_nDefaultExportChartHeight = 600;
uc_nDefaultExportChartWidth = 700;

This is a gantt chart and the way i caclulate the height and wodth is:

mv_nSavedChartHeight := Round( ( 600*mv_nRowsOnChart )/30 );
// where mv_nRowsOnChart is the number of rows displayed
// on the gantt chart
mv_nSavedChartHeight := Max( 600, ht );
mv_nSavedChartWidth := round( 700 * 2 );
And while exporting to a bmp file, i do
fv_dbChartControl.SaveToBitmapFile( strScratchFilename,
Rect( 0, 0, mv_nSavedChartWidth, mv_nSavedChartHeight ) );

Thanks for any reply.
- Suma.

Re: monitor resolution affects bmp output from chart control

Posted: Fri Oct 08, 2004 11:30 am
by Marjan
5889868 wrote:fv_dbChartControl.SaveToBitmapFile( strScratchFilename,
Rect( 0, 0, mv_nSavedChartWidth, mv_nSavedChartHeight ) );

When i save an image from a chart to a bmp file, some of the text information like x-axis lables towards the end and also the legend texts (although legend colors does show up) are missing from the bmp file. But when i increase the resolution and then output image to a file, it seem to have the right image with no missing text.
What's the resolution and color depth which shows this problem ? It is possible that setting color depth or resolution to low value might lead to poor output (missing parts). Still, using the following code I got good results (depending how many colors did I use in TeeChart):

Code: Select all

var bmp: TBitmap;
begin
  bmp := Chart1.TeeCreateBitmap(clWhite,Chart1.ClientRect,pf4Bit);
  try
    bmp.SaveToFile('d:\temp\test.bmp');
  finally
    bmp.Free;
  end;
end;