Article View: borland.public.cppbuilder.nativeapi
Article #3711Re: Slow pictures
From: Hans Galema
Date: Fri, 28 Apr 2006 20:42
Date: Fri, 28 Apr 2006 20:42
59 lines
2463 bytes
2463 bytes
Jos� wrote:
> screen becomes blank
There is nothing in your code that cares for that. Please explain.
> after one second (or more) the left picture appears.
> after another second (or more) the right picture appears.
bool toggle;
void loadphotos()
Oh. Why are you using a global bool and a standalone function ?
It is much better to make that a classmember of TForm1.
If you do you could also use two forms which display
at the same time.
void exchange(void)
ditto.
__fastcall TForm1::TForm1(TComponent* Owner)
: TFrame(Owner)
{
// set the second set invisible
Image2R->Visible = false;
Image2L->Visible = false;
}
You could as well do all in the timereventhandler.
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
Timer1->Enabled = false;
Image1R->Visible = ! Image1R->Visible;
Image1L->Visible = ! Image1L->Visible;
Image2R->Visible = ! Image2R->Visible;
Image2L->Visible = ! Image2L->Visible;
Application->ProcessMessages(); // does this have effect ?
FileR = ...
FileL = ...
if ( ! Image1R->Visible ) Image1R->Picture->LoadFromFile(fileR);
if ( ! Image2R->Visible ) Image2R->Picture->LoadFromFile(fileR);
if ( ! Image1L->Visible ) Image1L->Picture->LoadFromFile(fileL);
if ( ! Image2L->Visible ) Image2L->Picture->LoadFromFile(fileL);
Timer1->Enabled = true;
}
pProblems like this where you use a VCL component are better asked in:
borland.public.cppbuilder.vcl.components.using
Hans.
Technical Details
Message-ID:
<44527f19$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<e7t452dmulukkq0ss9hcd60jlc36lgbfo7@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,65d95fe0c39b12ef X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII Date: Fri, 28 Apr 2006 22:42:08 +0200 From: Hans Galema <notused@notused.nl> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Slow pictures References: <e7t452dmulukkq0ss9hcd60jlc36lgbfo7@4ax.com> In-Reply-To: <e7t452dmulukkq0ss9hcd60jlc36lgbfo7@4ax.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 145.98.201.248 Message-ID: <44527f19$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1146257177 145.98.201.248 (28 Apr 2006 13:46:17 -0700) Lines: 59 Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail