![]() |
private function aufrufen/Graphics.Fileformats
Gibt es irgendeine Möglichkeit eine private Funktion aufzurufen?
Ich müßte von TPicture die private function ReadData/WriteData aufrufen ich kann diese funktion nicht nachbauen, da mir der Zugriff auf die variable/funktion FileFormats - verwehrt bleibt gibt es hier irgendwelche workarounds? |
Re: private function aufrufen/Graphics.Fileformats
private Funktionen sind ja grad privat, damit keiner von außerhalb drauf zugreifen kann :zwinker:
|
Re: private function aufrufen/Graphics.Fileformats
stimmt schon, aber auf private properties kann man ja (wenn auch so richtig dirty) zugreifen ... deshalb die frage, ob es auch solche workarounds für proceduren gibt?
|
Re: private function aufrufen/Graphics.Fileformats
es gibt ReadDate/WriteData auch nochmal im Protected-Abschnitt und auf diese kannst du in einer Ableitung zugreifen
|
Re: private function aufrufen/Graphics.Fileformats
Zitat:
|
Re: private function aufrufen/Graphics.Fileformats
Hallo,
TPicture enthält ein property Graphic, reicht das nicht ? TPicture ist ja nur ein Container für ein TGraphic. Heiko |
Re: private function aufrufen/Graphics.Fileformats
Zitat:
|
Re: private function aufrufen/Graphics.Fileformats
Delphi-Quellcode:
[add]
type TMyPicture = class(TPicture)
procedure Save; end; procedure TMyPicture.Save; begin //LoadFromStream SaveToStream(...); end; // var Picture: TPicture; TMyPicture(Picture).Save; wobei FGraphic ja SaveToStream/LoadFromStream ja frei zugänglich hat
Delphi-Quellcode:
Picture.Graphic.SaveToStream(...);
Delphi-Quellcode:
type TMyGraphic = class(TGraphic)
procedure Save; end; procedure TMyGraphic.Save; begin //ReadData(Stream); WriteData(Stream); end; // var Picture: TPicture; TMyGraphic(Picture.Graphic).Save; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:32 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