Board index » cppbuilder » HELP: Slow image display first time

HELP: Slow image display first time

  I've seen a few questions asked about displaying an image, but I still
have the same problem. I'm very new to programming and I'm sure the
answear is simple, so I apologize now and would like to thank everyone
that has helped me through some simple tasks that has stumped me.
  My question is:
   1. When I run my application, the mainform has a image (.BMP)
background with  buttons on top of the image. With the image covering
the form or on a panel in the form, when it's ran the first time, you
can see it draw the form (instead of displaying the form, image, and
components at the same time). When I click a button to goto another
form, each form does the same thing (the first time each form is ran).
When I goto each form a second time, the display is instant. What can I
do?
    2. Can the main form be invisible and display only the image with
the installed components? If it can, what can I do?
  I apologize again if this is a repeat of any questions asked and would
like to thank everyone for their help and patience.

Sincerely,

Todd

 

Re:HELP: Slow image display first time


Quote
SSgt. MCDermaid wrote:
>   I've seen a few questions asked about displaying an image, but I
> still
> have the same problem. I'm very new to programming and I'm sure the
> answear is simple, so I apologize now and would like to thank everyone

> that has helped me through some simple tasks that has stumped me.
>   My question is:
>    1. When I run my application, the mainform has a image (.BMP)
> background with  buttons on top of the image. With the image covering
> the form or on a panel in the form, when it's ran the first time, you
> can see it draw the form (instead of displaying the form, image, and
> components at the same time). When I click a button to goto another
> form, each form does the same thing (the first time each form is ran).

> When I goto each form a second time, the display is instant. What can
> I
> do?
>     2. Can the main form be invisible and display only the image with
> the installed components? If it can, what can I do?
>   I apologize again if this is a repeat of any questions asked and
> would
> like to thank everyone for their help and patience.

> Sincerely,

> Todd

 Todd
What is happening is that it takes a while to do a LoadFromFile on a
bitmap, the reason that the second time it is fast is that the bitmap is
already in memory. There are ways around the loading of the first form
and subsequent forms but it would help if you would post some trimmed
down sample code of what you are trying to do......
-jc
--
Three frameworks for the elven-kings under the skys,
Seven for the Dwarf-loads in their halls of stone,
Nine for the mortal men doomed to die,
In the land of Mordor where the shadows lie,
One framework to rule them all, One framework to find them,
One framework to bring them all and in darkness bind them,
In the land of Mordor where the shadows lie,
It is written that MFC will die,
In the light, the VCL is born
The new age of freedom is upon us,
Borland sounds its mighty horn,
The evil empire cowers in sudden fear,
As it knows the end is near...............

Other Threads