TBITBMP 到底应该怎么释放??
bool __fastcall CBmpOp::CreateNameBoard(Graphics::TBitmap *bmpBoard,const AnsiString &strName,int fontsize,long fontcolor,int maxlen){ WideString wstrName=strName; int strlen; strlen=wstrName.Length(); if(strlen>maxlen) { strlen=maxlen; } bmpBoard->PixelFormat=pf24bit; //听说这个地方在BCB和DELPHI中,多线程使用的时候会出问题 bmpBoard->Width=(bmpBoard->Canvas->TextWidth("一")+2)*strlen; bmpBoard->Height=bmpBoard->Canvas->TextHeight("一"); bmpBoard->Canvas->Brush->Color=MASKCOLOR; bmpBoard->Canvas->Font->Color=TColor(fontcolor); bmpBoard->Canvas->Font->Name="宋体"; bmpBoard->Canvas->Font->Height=-1*fontsize; bmpBoard->Canvas->Font->Charset=GB2312_CHARSET; bmpBoard->Canvas->FillRect(Rect(0,0,bmpBoard->Width,bmpBoard->Height)); int p(0); for(int i=0;i<strlen;i++) { //bmpBoard->Canvas->TextOutA(p,0,wstrName.SubString(i+1,1)); ::TextOutW(bmpBoard->Canvas->Handle,p,0,wstrName.SubString(i+1,1).c_bstr(),1); p+=bmpBoard->Canvas->TextWidth(wstrName.SubString(i+1,1))+2; } return true;}//测试代码 for(;;) { Graphics::TBitmap *bmpNameBoard=new Graphics::TBitmap(); CreateNameBoard(bmpNameBoard.....); delete bmpNameBoard; }