monitor resolution affects bmp output from chart control?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Suma
Newbie
Newbie
Posts: 11
Joined: Fri Nov 15, 2002 12:00 am
Location: Bellevue, WA
Contact:

monitor resolution affects bmp output from chart control?

Post by Suma » Wed Oct 06, 2004 11:30 pm

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

Suma
Newbie
Newbie
Posts: 11
Joined: Fri Nov 15, 2002 12:00 am
Location: Bellevue, WA
Contact:

Post by Suma » Thu Oct 07, 2004 6:15 pm

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.

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Re: monitor resolution affects bmp output from chart control

Post by Marjan » Fri Oct 08, 2004 11:30 am

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;
Marjan Slatinek,
http://www.steema.com

Post Reply