안녕하세요. 천리안 프로그래머 포럼 C++Builder 담당 임펠리테리입니다.
TSpeedButton의 Glyph는 스트레칭을 지원하지 않습니다. 이미지를 스트레치하려면
직접 코드로 해주어야 하는데, 폼의 OnCreate 등의 이벤트에서 해주면
원하시는 것과 동일한 효과를 얻으실 수 있을겁니다.
void __fastcall TForm1::FormCreate(TObject *Sender)
{
Graphics::TBitmap *bmp = new Graphics::TBitmap;
bmp->Width = SpeedButton1->Width-10;
bmp->Height = SpeedButton1->Height-10;
bmp->Canvas->StretchDraw(Rect(0, 0, bmp->Width, bmp->Height),
SpeedButton1->Glyph);
SpeedButton1->Glyph->Assign(bmp);
delete bmp;
}
그럼 참고하시길...
임펠리테리 박지훈이었습니다.
( http://myhome.thrunet.com/~cbuilder, cbuilder@thrunet.com)
|