problem of "SaveToBitmapFile function"

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
sjsun116
Newbie
Newbie
Posts: 4
Joined: Wed Nov 09, 2011 12:00 am

problem of "SaveToBitmapFile function"

Post by sjsun116 » Fri Mar 23, 2012 7:14 am

My software Teechart version is "Teechart Pro v2011.03.30407".
My application request to save a new chart as BMP file when a new point series or lin series was drawn in chart .But the BMP file saved using function "SaveToBitmapFile" is all the same. I don't know how to solve this problem ,very very urgent ! Who can help me,Thank you. I'd appreciate it.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: problem of "SaveToBitmapFile function"

Post by Narcís » Fri Mar 23, 2012 12:58 pm

Hi sjsun116,
My software Teechart version is "Teechart Pro v2011.03.30407"
Current version is v2011.04 and v2012.05 will be published very soon. You might be interested in testing the latest version.
But the BMP file saved using function "SaveToBitmapFile" is all the same.
What do you exactly mean with this, could you please provide more detailed information? A simple example project we can run "as-is" to reproduce the problem here would also be helpful.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

sjsun116
Newbie
Newbie
Posts: 4
Joined: Wed Nov 09, 2011 12:00 am

Re: problem of "SaveToBitmapFile function"

Post by sjsun116 » Tue Mar 27, 2012 2:59 pm

Hi Narics,
Thank you.
A question:are these version compatible?

An example(BCB 6.0) such as:
AnsiString ToName;
DateSeparator = '-';
ShortDateFormat = "yyyy/mm/dd";
ToName = DateToStr(Date());
ShortDateFormat = "hh/mm/ss";
ToName = "2D-"+ToName+"-"+DateToStr(Time());
SaveDialog1->FileName = ToName;
if (SaveDialog1->Execute())
{
if (FileExists(SaveDialog1->FileName))
{
DeleteFile(SaveDialog1->FileName);
}
Chart1->SaveToBitmapFile(SaveDialog1->FileName);//chart1 is a Chart Unit
}



This example show how to capture and save the chart picture,when I draw line or point and so on in Chart1.
but I can't get the changed chart picture.

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: problem of "SaveToBitmapFile function"

Post by Yeray » Wed Mar 28, 2012 2:38 pm

Hi,

I'm not sure to understand the exact problem either.
I've added a Chart and a TLineSeries with some values at design time, in a new C++Builder application. I've also doped a Button to the form and then used your code just adding a point, and it seems to work fine for me here:

Code: Select all

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  Chart1->Series[0]->Add(100);

  AnsiString ToName;
  DateSeparator = '-';
  ShortDateFormat = "yyyy/mm/dd";
  ToName = DateToStr(Date());
  ShortDateFormat = "hh/mm/ss";
  ToName = "2D-"+ToName+"-"+DateToStr(Time())+".bmp";
  SaveDialog1->FileName = ToName;
  if (SaveDialog1->Execute())
  {
    if (FileExists(SaveDialog1->FileName))
    {
      DeleteFile(SaveDialog1->FileName);
    }
    Chart1->SaveToBitmapFile(SaveDialog1->FileName);//chart1 is a Chart Unit
  }
}
If you still have problems with it, please try to arrange a simpl example project we can run as-is to reproduce the problem here.
Thanks in advance.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

sjsun116
Newbie
Newbie
Posts: 4
Joined: Wed Nov 09, 2011 12:00 am

Re: problem of "SaveToBitmapFile function"

Post by sjsun116 » Tue Apr 03, 2012 4:18 pm

Hi,
I upload a test file developed using C++builder 6.0. Please download three part and then decompress .
The test have three button:draw1,draw2 and ScreenShot.When you click the button "draw1" or the button "draw2",it will draw picture 1 or picture 2.
when you click the button "ScreenShot",it will capture the chart picture.
The problem :
when you click the button "ScreenShot" after "draw1",you will get the picture1.But afterwards you click the button "ScreenShot" after "draw2",you can't
get the picture2.
when you click the button "ScreenShot" after "draw2",you will get the picture2.But afterwards you click the button "ScreenShot" after "draw1",you can't
get the picture1.
How can I get the changed chart picture?


Thanks in advance.
test.part01.rar
test file 01
(488.28 KiB) Downloaded 374 times
test.part02.rar
test file 02
(488.28 KiB) Downloaded 356 times
test.part03.rar
test file 03
(10.61 KiB) Downloaded 342 times

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: problem of "SaveToBitmapFile function"

Post by Yeray » Wed Apr 04, 2012 9:50 am

Hi sjsun116,

I could reproduce it with v2011.03 but it seems to work fine in v2011.04 and the current v2012.05.
Could you please give it a try?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

sjsun116
Newbie
Newbie
Posts: 4
Joined: Wed Nov 09, 2011 12:00 am

Re: problem of "SaveToBitmapFile function"

Post by sjsun116 » Fri Apr 06, 2012 2:08 am

Hi,

OK,Thank you very much.

Post Reply