08/11/29 17:44:27
>>848
これで行けるはずなんだが・・・うーんわからん
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Graphics::TBitmap* bt = new Graphics::TBitmap;
BLENDFUNCTION blend = {AC_SRC_OVER, 0, 100, 0};
TCanvas* ti = Image1->Canvas;
RGBQUAD rgbq;
bt->Width = 256;
bt->Height = 256;
bt->PixelFormat = pf32bit;
for (int i = 0; i < 255; i++) {
int* sc = reinterpret_cast<int*>(bt->ScanLine[i]);
for (int j = 0; j < 255; j++) {
rgbq.rgbBlue = i;
rgbq.rgbGreen = j;
sc[j] = reinterpret_cast<int&>(rgbq);
}
}
BOOL RESULT =
::AlphaBlend(ti->Handle, 0, 0, Image1->Width, Image1->Height,
bt->Handle, 0, 0, bt->Width, bt->Height,
blend);
if (RESULT == FALSE) {
Application->MessageBox(L"失敗!", L"", MB_OK);
}
delete bt;
}