怎么样可以实现把文字存成PNG
风子啊啊 2015-03-26 03:30:03 请问,怎么可以把文字保存成背景是透明的PNG呢
Graphics::TBitmap *bmp = new Graphics::TBitmap();
TPngImage *imagex = new TPngImage();
bmp->Width = Edit5->Text.ToInt();
bmp->Height = Edit4->Text.ToInt();
TRect rect4(0, 0, bmp->Width-1, bmp->Height-1);
bmp->Canvas->TextRect(rect4, Text, Graphics::TTextFormat()<<tfSingleLine<< tfCenter<<tfVerticalCenter);
bmp->Transparent = true;
// bmp->TransparentColor = bmp->Canvas->Pixels[0][0];
imagex->Assign(bmp);
String fn=Now().FormatString("yyyymmddhhmmss")+".png" ;
imagex->SaveToFile(fn);
这样存出来,还是有背景色的。。。
求助求助