BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Pretty simple question

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
12Care
Guest





PostPosted: Mon Aug 29, 2005 4:35 am    Post subject: Pretty simple question Reply with quote



Before loading a new picture from file into a TImage, I want:
1. clear the previous picture
2. to show something like, "Loading picture..."

What's good way to do that?


Back to top
Ivan Sivak Jr.
Guest





PostPosted: Mon Aug 29, 2005 7:15 am    Post subject: Re: Pretty simple question Reply with quote



I think you don't need to clear the previous picture,
just try something like this:
label1.caption := 'Loading Picture...';
Image1.Picture.LoadFromFile (path);
label1.caption := 'Picture Loaded';




"12Care" <12care (AT) san (DOT) rr.com> píše v diskusním příspěvku
news:43129067 (AT) newsgroups (DOT) borland.com...
Quote:
Before loading a new picture from file into a TImage, I want:
1. clear the previous picture
2. to show something like, "Loading picture..."

What's good way to do that?




Back to top
Sasa Zeman
Guest





PostPosted: Mon Aug 29, 2005 8:08 am    Post subject: Re: Pretty simple question Reply with quote



Ivan Sivak Jr. wrote:

Quote:
I think you don't need to clear the previous picture,
just try something like this:
label1.caption := 'Loading Picture...';
Image1.Picture.LoadFromFile (path);
label1.caption := 'Picture Loaded';

To clear picture:
Image1.Picture.Assign(nil);

Also, be careful with assigning nil with bitmap pictures if your
program was intented to work on W9x, there is a memory leak in D7
(fixed by service pack).

In some cases, it is very useful to manually clear the picture(s)
first, in order to preserve unnecessary memory fragmentation and speed
decreasing. Otherwise, during loading new picure will be first loaded
in memory - then will be free original (see TPicture.LoadFromFile code).


Sasa
--
www.szutils.net

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.