CLX Projekt unter Delphi 7 Architekt:
Hallo,
Ich setzte verschiedene Panel auf einer Form ein. Diese möchte Ich nun Halb-Transparent machen.
Bis jetzt habe Ich dazu folgenden Code:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28:
| procedure TTiCidItem.SetTransparency(); var canSShot : TCanvas; rectShot : TRect; bmpTmpPic: TBitMap;
begin canSShot := TCanvas.Create; canSShot.Handle := ParCtrl.Canvas.Handle; try rectShot.Left := iPanelYPos; rectShot.Top := iPanelXPos; rectShot.Right := iPanelYPos + iPanelWidth; rectShot.Bottom := iPanelYPos + iPanelHeight;
bmpTmpPic := TBitmap.Create; bmpTmpPic.Width := iPanelWidth; bmpTmpPic.Height := iPanelHeight;
bmpTmpPic.Canvas.CopyMode := cmSrcCopy;
bmpTmpPic.Canvas.CopyRect(rectShot, canSShot, rectShot);
finally end;
end; |
Doch bei
Delphi-Quelltext
1:
| bmpTmpPic.Canvas.CopyRect(rectShot, canSShot, rectShot); |
steigt er aus und sagt mir: Leinwand/Bild erlaubt kein Zeichnen.
Hat jemand vieleicht eine Idee, woran das liegen könnte? Ich bin noch Delphi Anfänger und kann mir da noch nicht so recht helfen
Viele Grüße,
Christian
Moderiert von
Motzi: Code- durch Delphi-Tags ersetzt.