Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi problem mit bitmap in eigener komponente (https://www.delphipraxis.net/31165-problem-mit-bitmap-eigener-komponente.html)

heiopei 5. Okt 2004 13:57


problem mit bitmap in eigener komponente
 
hallo,
ich bin grad dabei meine erste richtige komponente zu schreiben.
ich verwende dabei bei einer funktion als übergabeparameter ein bitmap!
allerdings kann ich jetzt nur auf irgendwelche bmheight.. oder so zugreifen!

wie schaffe ich es, "normal" auf das bitmap zuzugreifen (canvas...)?

danke,
heiopei

Muetze1 5. Okt 2004 14:45

Re: problem mit bitmap in eigener komponente
 
Moin!

In der Windows.pas und in der Graphics.pas ist jeweils ein TBitmap definiert. Einmal als Klasse (Graphics) und einmal als Record (Windows). Bei dir hat er nun das Ding von Windows. Abhilfe schaffen hier 2 Dinge:

1. Bei jeder Verwendung von TBitmap ein Graphics. davor schreiben, also z.B. so:
Delphi-Quellcode:
Var
  Bmp : Graphics.TBitmap;
Begin
  Bmp := Graphics.TBitmap.Create;
...
ODER

2. Du sorgst einfach dafür, das die Windows Unit vor der Graphics Unit in der Usesliste steht...

MfG
Muetze1


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:11 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