Board index » delphi » Detecting TPicture.Loadfromfile - 2nd try.
Alan Hal
![]() Delphi Developer |
Wed, 21 Aug 2002 03:00:00 GMT
|
Alan Hal
![]() Delphi Developer |
Wed, 21 Aug 2002 03:00:00 GMT
Detecting TPicture.Loadfromfile - 2nd try.
I've asked this before but still don't have a satisfactory answer. I
need to detect when an image is loaded into the Picture of a TImage component. Grateful for any suggestions. Alan Hale |
Bj?rge S?the
![]() Delphi Developer |
Wed, 21 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.Hi ! You may write an event handler, and hook into TImage.Picture.OnChange or MyImage.Picture.OnChange:=MyPictureChanged; procedure TMyForm.MyPictureChanged(Sender: TObject); -- Alan Hale skrev i meldingen <38C0EDBC.90BAC...@clara.net>... Quote>I've asked this before but still don't have a satisfactory answer. I |
Martin Wei
![]() Delphi Developer |
Wed, 21 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.QuoteAlan Hale <adh...@clara.net> wrote in message Quote> I've asked this before but still don't have a satisfactory answer. I ---OH ------- property Empty: Boolean; Description Use Empty to determine whether the graphic is bound to an image. Each HTH Martin |
Alan Hal
![]() Delphi Developer |
Wed, 21 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.Thanks for the reply - but surely the problem with either of these is that they will respond to ANY event affecting the picture (like if I draw on it). OnProgress according to the Help "Occurs periodically during slow operations that affect the image" so sounds like it could not be guaranteed to occur anyway. Alan Hale Quote"Bj?rge S?ther" wrote: |
Alan Hal
![]() Delphi Developer |
Wed, 21 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.Mmm - maybe. But I want to trigger an operation as soon as the graphic is loaded. And also if the graphic changes i.e. if a new one is loaded. Alan Hale Quote"Martin Wei?" wrote: |
Gordon Whitt
![]() Delphi Developer |
Wed, 21 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.QuoteIn article <38C14394.C409D...@clara.net>, Alan Hale <adh...@clara.net> writes: being loaded. Gordon. MGCSoft |
Alan Hal
![]() Delphi Developer |
Thu, 22 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.I'm working on a custom component derived from TImage and I would like to be able to detect programatically when a graphic is loaded and then call a particular procedure. I could call the procedure from the main application every time a graphic is loaded, but since calling this procedure is essential to the functionality of the component and needs to always be done I would prefer the component to detect when a graphic is loaded. Alan Hale QuoteGordon Whittam wrote: |
Michael Philli
![]() Delphi Developer |
Thu, 22 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.QuoteOn Sun, 05 Mar 2000 06:40:37 GMT, Alan Hale <adh...@clara.net> wrote: inherited LoadFromFile then calls your routine? Michael |
Alan Hal
![]() Delphi Developer |
Fri, 23 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.QuoteMichael Phillips wrote: I can see is that what you would have to do is make a TPicture-derived custom component and inherit, extend LoadFromFile from there and make my TImage-derived component use this.. This would require the user to know they have to use the custom TPicture method (let's call it TadhPicture.LoadFromFile) rather than tPicture.LoadFromFile. Which doesn't really take me any further on in my aim of eliminating unnecessary work for the component user. I'm very open to correction or further suggestions however. Alan Hale |
Gordon Whitt
![]() Delphi Developer |
Fri, 23 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.QuoteIn article <38C35790.CA66D...@clara.net>, Alan Hale <adh...@clara.net> writes: just replace the inherited method, from where you can call the inherited LoadFromFile(FileName); From the D3 Help: Gordon. MGCSoft |
Alan Hal
![]() Delphi Developer |
Sat, 24 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.I may be out of my depth - but I don't understand how you would do this when Loadfromfile is a method of TPicture, whilst my component is a TImage descendant. Alan Hale QuoteGordon Whittam wrote: |
Gordon Whitt
![]() Delphi Developer |
Sat, 24 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.QuoteIn article <38C55B3A.6CD56...@clara.net>, Alan Hale <adh...@clara.net> writes: inherited Picture.LoadFromFile(FileName); I've attached the source of little demo (D3) in your mail. Gordon. MGCSoft |
Alan Hal
![]() Delphi Developer |
Sat, 24 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.Gordon This is just what I need - excellent. Many thanks for your help. Alan QuoteGordon Whittam wrote: |
Alan Hal
![]() Delphi Developer |
Sun, 25 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.Mmm. When I looked again (it was getting late last night when I first looked) unfortunately it's not quite what I want. The component user has to know to use TMyImage.LoadfromFile rather than TMyImage.Picture.Loadfromfile - so I'm only slightly further on in making less work for that user. If I have to tell them to do that, I may as well tell them to call the procedure I need to be run themselves from Picture.Loadfromfile. Still, I learnt something from your code and much appreciated. Alan QuoteAlan Hale wrote: |
Gordon Whitt
![]() Delphi Developer |
Mon, 26 Aug 2002 03:00:00 GMT
Re:Detecting TPicture.Loadfromfile - 2nd try.QuoteIn article <38C5F53C.5E0B...@clara.net>, Alan Hale <adh...@clara.net> writes: I think you're going to have to declare a TImage as one of your variables Gordon. MGCSoft |
2. problem of Tpicture.Loadfromfile(..)
3. Problem using TPicture.LoadFromFile in D3 Thread
4. Overriding TPicture::LoadFromFile from TImage descendant
5. Problem with TClientDataSet.LoadFromFile in try except block!
7. Copiing buffer to VGA 12h mode *HELP* 2nd try
8. PLEASE HELP!! =) 2nd try, lol