![]() |
2 Probleme: Transparent eines Bitmaps, Fontgröße/art festleg
Hey Community,
1.Problem möcht in nem spiel einen ball sich bewegen lassen das Bitmap ist 32*32 groß und hat aber als hintergrund eine weiße farbe. Nun möchte ich diese Farbe wegbekommen. Hier der Quelltext:
Delphi-Quellcode:
//Ball zeichen
ball_paint:= TBitmap.Create(); with ball_paint do begin Loadfromfile(ball_path); width:=34; height:=42; //Transparent machen TransparentColor := Canvas.Pixels[1,1]; TransparentMode := tmFixed; Transparent:=True; end; Und das malen in die Paintbox:
Delphi-Quellcode:
area_tmp.Canvas.CopyRect(rect(bx,by,bx+ball_paint.Width,by+ball_paint.height),ball_paint.Canvas,rect(0,0,ball_paint.Width,ball_paint.Height));
2. Problem Ich möchte auf ne Anzeigetafel ein Schrift ausgeben. Dies funktioniert schon, dochj möchte ich die Schriftart und Schriftgröße ändern Momentan gebe ich sie so aus:
Delphi-Quellcode:
Danke schon einmal im vorraus
area_tmp.Canvas.TextOut((trunc(main.clientwidth/2)-trunc(anzeige_paint.Width/2))+100, 110, inttostr(spieler1_punkte));
area_tmp.Canvas.TextOut((trunc(main.clientwidth/2)-trunc(anzeige_paint.Width/2))+190, 110, inttostr(spieler2_punkte)); Mit freundlichen Grüßen Dennis Schmidt |
Re: 2 Probleme: Transparent eines Bitmaps, Fontgröße/art fes
Hallo Dennis :-) Mache bitte für jedes deiner beiden Probleme ein eigenes Thema auf. Danke
*** GESCHLOSSEN *** |
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:21 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz