Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   Delphi 2 Probleme: Transparent eines Bitmaps, Fontgröße/art festleg (https://www.delphipraxis.net/114789-2-probleme-transparent-eines-bitmaps-fontgroesse-art-festleg.html)

smgdennis 31. Mai 2008 12:39


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:
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));
Danke schon einmal im vorraus

Mit freundlichen Grüßen
Dennis Schmidt

SirThornberry 31. Mai 2008 13:46

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 11:20 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz