<textarea class="cpp" rows="10" cols="60" name="code">
#include
#pragma hdrstop #include "Unit1.h"
#include
#include
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//--------------------------------------------------------------------------- void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
long i, j;
FILE *fp;
unsigned char *image_buf;
char fname_bmp[24882];
unsigned char header[54];
unsigned char *image;
int xsize;
int ysize;
char *filename;
image_buf=(unsigned char *)malloc((size_t)xsize*ysize*3);
if (image_buf==NULL) sprintf(fname_bmp, "123.bmp", filename); if ((fp=fopen(fname_bmp, "rb"))==NULL)
fread(header, sizeof(unsigned char),54,fp);
fread(image_buf, sizeof(unsigned char), (size_t)(long)xsize*ysize*3, fp); for(i=0; iPicture->Bitmap->ScanLine[(Source->Height-1)-w];
Y=static_cast(Line[3*v] Line[3*v 1] Line[3*v 2])/3;
testIMG[w][v] = Y;
}
}
for(w=0;wHeight;w )
{
for(v=0;vWidth;v )
{
Line=(BYTE*)Target->Picture->Bitmap->ScanLine[(Source->Height-1)-w];
Line[3*v]=(BYTE)testIMG[w][v];
Line[3*v 1]=(BYTE)testIMG[w][v];
Line[3*v 2]=(BYTE)testIMG[w][v];
}
}
Target->Canvas->Draw(0,0,Target->Picture->Bitmap); } </textarea>
[C Error] Unit1.cpp(61): E2451 Undefined symbol 'Source'
[C Error] Unit1.cpp(62): E2274 < expected
[C Error] Unit1.cpp(70): E2451 Undefined symbol 'Target' 請問大家這要怎麼改阿,謝謝