 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
12Care Guest
|
Posted: Mon Aug 29, 2005 4:35 am Post subject: Pretty simple question |
|
|
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
|
Posted: Mon Aug 29, 2005 7:15 am Post subject: Re: Pretty simple question |
|
|
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
|
Posted: Mon Aug 29, 2005 8:08 am Post subject: Re: Pretty simple question |
|
|
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 |
|
 |
|
|
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
|
|