DLL 我用了TBitmap ,编译时通不过
我用了TBitmap ,编译时通不过,当然在 Build with runtime package 选定时没问题,如果没有选,编译时所有和TBitmap有关的的都要报错了,请问这是为什么呢?
extern "C"
{
int WINAPI __export getfontwidth(LPSTR outstr, LPSTR lfFaceName,
short int lfOrientation, short int lfHeight,
short int lfWidth, short int lfBold, short int lfItalic)
{
int x,y,ByteLength,width,height;
AnsiString outText;
outText = AnsiString(outstr);
Graphics::TBitmap *pBitmap = new Graphics::TBitmap();
Byte *ptr;
pBitmap->Canvas->Font->Name = lfFaceName;
pBitmap->Canvas->Font->Height = lfHeight;
pBitmap->Height = pBitmap->Canvas->TextHeight(outText);
pBitmap->Width = pBitmap->Canvas->TextWidth(outText);
pBitmap->PixelFormat = pf8bit;
pBitmap->Canvas->TextOutA(0,0,outText);
int firstColum = 0;
int count = 0;
for (x = 0; x < pBitmap->Width ; x ++)
{
bool isLineEmpty = true;
for (y = 0; y < pBitmap->Height ; ++ y)
if (pBitmap->Canvas->Pixels[x][y] == 0)
{
isLineEmpty = false;
break;
}
if ((firstColum == 0) && (!isLineEmpty))
{
firstColum = x;
}
if ((firstColum != 0)&& (!isLineEmpty))
{
++ count;
}
}
return (count);
}
}