tewehuang
asked on
i use the c++ bilder ,and i want to change the bitmap file to gif.
i just want to change the bitmap file to gif file .how could i do?
my source code is:
while(!Query1->Eof)
{
char szName[255];
// get data from first table
// and save data into csc
String csc = Query1->FindField("STKCODE ")->AsStri ng;
String mkt = Query1->FindField("MKT")-> AsString;
// into csc to second table and get data
if(mkt == "TSE"){
Query2->Close();
Query2->SQL->Clear();
Query2->SQL->Add("select scode,syear*100+smon,T3950 ,T3100");
Query2->SQL->Add("from AP.ASEARN");
Query2->SQL->Add("where SCODE =:sss");
Query2->ParamByName("sss") ->AsString = csc;
Query2->Active=TRUE;
// use the data of second table to draw the line chart
Series1->DataSource=Query2 ;
Series1->ParentChart=DBCha rt1;
Series1->XLabelsSource="sy ear*100+sm on";
Series1->YValues->ValueSou rce= "T3950";
Series2->DataSource=Query2 ;
Series2->ParentChart=DBCha rt1;
Series2->XLabelsSource="sy ear*100+sm on";
Series2->YValues->ValueSou rce= "T3100";
wsprintf(szName,"e:\\gsear nsale\\gse arnsale%s. bmp",csc);
DBChart1->SaveToBitmapFile (szName);
Query1->Next();
}
and i know maybe i should reload the saving bitmap file again!but i don't know what's kind of method i can use?
please help me .thanks.
my source code is:
while(!Query1->Eof)
{
char szName[255];
// get data from first table
// and save data into csc
String csc = Query1->FindField("STKCODE
String mkt = Query1->FindField("MKT")->
// into csc to second table and get data
if(mkt == "TSE"){
Query2->Close();
Query2->SQL->Clear();
Query2->SQL->Add("select scode,syear*100+smon,T3950
Query2->SQL->Add("from AP.ASEARN");
Query2->SQL->Add("where SCODE =:sss");
Query2->ParamByName("sss")
Query2->Active=TRUE;
// use the data of second table to draw the line chart
Series1->DataSource=Query2
Series1->ParentChart=DBCha
Series1->XLabelsSource="sy
Series1->YValues->ValueSou
Series2->DataSource=Query2
Series2->ParentChart=DBCha
Series2->XLabelsSource="sy
Series2->YValues->ValueSou
wsprintf(szName,"e:\\gsear
DBChart1->SaveToBitmapFile
Query1->Next();
}
and i know maybe i should reload the saving bitmap file again!but i don't know what's kind of method i can use?
please help me .thanks.
ASKER
Adjusted points from 100 to 120
ASKER
i just reading the homepage.
but i can't understand how will i do.
because i don't know the delphi source
code.so would you mind write a sample to me.
thanks!
but i can't understand how will i do.
because i don't know the delphi source
code.so would you mind write a sample to me.
thanks!
If you haven't done this already, to use the component, you must first download it from one of these sites:
http://www.melander.dk/cgi-bin/download/mirrors?package=tgifimage
Once you've downloaded it, follow these installation instructions for your version of C++ Builder:
http://www.melander.dk/delphi/gifimage/release_notes/install.html
Here's the code to convert from bmp to gif:
Graphics::TBitmap * bm = new Graphics::TBitmap();
TGIFImage *gf = new TGIFImage();
bm->LoadFromFile("test.bmp ");
gf->Assign(bm);
gf->SaveToFile("test.gif") ;
delete bm;
delete gf;
If you need help to convert back the other way then let me know. Make sure you include the appropriate headers.
http://www.melander.dk/cgi-bin/download/mirrors?package=tgifimage
Once you've downloaded it, follow these installation instructions for your version of C++ Builder:
http://www.melander.dk/delphi/gifimage/release_notes/install.html
Here's the code to convert from bmp to gif:
Graphics::TBitmap * bm = new Graphics::TBitmap();
TGIFImage *gf = new TGIFImage();
bm->LoadFromFile("test.bmp
gf->Assign(bm);
gf->SaveToFile("test.gif")
delete bm;
delete gf;
If you need help to convert back the other way then let me know. Make sure you include the appropriate headers.
I would also find out first if you have gif support first, before you install TGifImage to avoid conflicts. As some package come with gif support. Like RX Library 2.60. To test if you have gif support slap a image component on a form
under the Picture property press Load and see if *.gif is included under the file types. You can disable the gif support in RX Library 2.60 and other packages if you want to use TGifImage Read ReadMe File.
under the Picture property press Load and see if *.gif is included under the file types. You can disable the gif support in RX Library 2.60 and other packages if you want to use TGifImage Read ReadMe File.
ASKER
dear jbodom:
thanks for your help .but i can't
link the first web.could you mind show
me anthoer web address.thanks
tewehuang
thanks for your help .but i can't
link the first web.could you mind show
me anthoer web address.thanks
tewehuang
ASKER
dear jbodom:
thanks for your help .but i can't
link the first web.could you mind show
me anthoer web address.thanks
tewehuang
thanks for your help .but i can't
link the first web.could you mind show
me anthoer web address.thanks
tewehuang
ASKER
i just use the method.
but how file i must include.
my means is like *.h.
my source code is :
void __fastcall TForm1::FormCreate(TObject *Sender)
{
char szName[255];
char szName1[255];
while(!Query1->Eof)
{
//get the ӪѸê®Æªºstkcode
String ind_stk = Query1->FindField("STKCODE ")->AsStri ng;
String mkt = Query1->FindField("MKT")-> AsString;
if (mkt == "TSE"){
Query2->Close();
Query2->SQL->Clear();
Query2->SQL->Add("select sdate,cp");
Query2->SQL->Add("from ap.aprcd_e");
Query2->SQL->Add("where stkcode=:mem");
Query2->ParamByName("mem") ->AsString =ind_stk;
Query2->Active = TRUE;
//String stk_date = Query2->FindField("SYEAR*1 00+SMON")- >AsString;
/*Query3->Close();
Query3->SQL->Clear();
Query3->SQL->Add("select syear*100+smon,cp");
Query3->SQL->Add("from ap.aisprcw");
Query3->SQL->Add("where indid='Y9999'");
Query3->SQL->Add("and (syear*100+smon) >=:date");
Query3->ParamByName("date" )->AsStrin g=stk_date ;
Query3->Active = TRUE;
*/
Series1->DataSource=Query2 ;
Series1->ParentChart=DBCha rt1;
Series1->XLabelsSource="sd ate";
Series1->YValues->ValueSou rce = "cp";
/*Series2->DataSource=Quer y3;
Series2->ParentChart=DBCha rt1;
Series2->XLabelsSource="sy ear*100+sm on";
Series2->YValues->ValueSou rce = "cp";
*/
wsprintf(szName,"e:\\gprcd \\gprcd%s. bmp",ind_s tk);
wsprintf(szName1,"e:\\gprc d\\gprcd%s .gif",ind_ stk);
DBChart1->SaveToBitmapFile (szName);
Graphics::TBitmap * bm = new Graphics::TBitmap();
TGIFImage *gf = new TGIFImage();
bm->LoadFromFile("szName") ;
gf->Assign(bm);
gf->SaveToFile("szName1");
delete bm;
delete gf;
Query1->Next();
}
the error meaaage is :
[C++ Error] Unit1.cpp(6): E2209 Unable to open include file 'gifimage.pas'.
[C++ Error] Unit1.cpp(62): E2451 Undefined symbol 'TGIFImage'.
thanks for your help!
but how file i must include.
my means is like *.h.
my source code is :
void __fastcall TForm1::FormCreate(TObject
{
char szName[255];
char szName1[255];
while(!Query1->Eof)
{
//get the ӪѸê®Æªºstkcode
String ind_stk = Query1->FindField("STKCODE
String mkt = Query1->FindField("MKT")->
if (mkt == "TSE"){
Query2->Close();
Query2->SQL->Clear();
Query2->SQL->Add("select sdate,cp");
Query2->SQL->Add("from ap.aprcd_e");
Query2->SQL->Add("where stkcode=:mem");
Query2->ParamByName("mem")
Query2->Active = TRUE;
//String stk_date = Query2->FindField("SYEAR*1
/*Query3->Close();
Query3->SQL->Clear();
Query3->SQL->Add("select syear*100+smon,cp");
Query3->SQL->Add("from ap.aisprcw");
Query3->SQL->Add("where indid='Y9999'");
Query3->SQL->Add("and (syear*100+smon) >=:date");
Query3->ParamByName("date"
Query3->Active = TRUE;
*/
Series1->DataSource=Query2
Series1->ParentChart=DBCha
Series1->XLabelsSource="sd
Series1->YValues->ValueSou
/*Series2->DataSource=Quer
Series2->ParentChart=DBCha
Series2->XLabelsSource="sy
Series2->YValues->ValueSou
*/
wsprintf(szName,"e:\\gprcd
wsprintf(szName1,"e:\\gprc
DBChart1->SaveToBitmapFile
Graphics::TBitmap * bm = new Graphics::TBitmap();
TGIFImage *gf = new TGIFImage();
bm->LoadFromFile("szName")
gf->Assign(bm);
gf->SaveToFile("szName1");
delete bm;
delete gf;
Query1->Next();
}
the error meaaage is :
[C++ Error] Unit1.cpp(6): E2209 Unable to open include file 'gifimage.pas'.
[C++ Error] Unit1.cpp(62): E2451 Undefined symbol 'TGIFImage'.
thanks for your help!
You need to include
#include "gifimage.hpp"
#include "gifimage.hpp"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i just include the headle file "gifimage.hpp".but the error message is
[C++ Error] gifimage.pas(1): E2141 Declaration syntax error.
and appear in the gifimage.h file.
how will i debug?
thanks!
tewehuang
[C++ Error] gifimage.pas(1): E2141 Declaration syntax error.
and appear in the gifimage.h file.
how will i debug?
thanks!
tewehuang
ASKER
thanks my freiend:i already to find the
correct way to solve.
thanks a lots.
eric
correct way to solve.
thanks a lots.
eric
http://www.melander.dk/delphi/gifimage/