By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,511 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

Loading numerous pictures

P: n/a
Hi,

I have a project with various forms that each include a number of picture
boxes and panels with background images. When these forms first load, they
kind of load in "pieces", with the pictures coming to view consecutively,
even on a 1.6 Ghz processor with 512 MB RAM. The pictures are loaded in the
Form_Load event. Is there a way for them to all load perfectly before the
user sees the form?

Thanks,
Nathan
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Nathan,

you could try using Me.SuspendLayout() before you start loading all your
child controls and pictures and then call Me.ResumeLayout() after you've
finished loading all of them.

hope this helps..
Imran.

"Nathan" <nk*********************@softhome.net> wrote in message
news:Oy**************@TK2MSFTNGP11.phx.gbl...
Hi,

I have a project with various forms that each include a number of picture
boxes and panels with background images. When these forms first load, they kind of load in "pieces", with the pictures coming to view consecutively,
even on a 1.6 Ghz processor with 512 MB RAM. The pictures are loaded in the Form_Load event. Is there a way for them to all load perfectly before the
user sees the form?

Thanks,
Nathan

Nov 21 '05 #2

P: n/a
Thanks for the suggestion. I tried it but it didn't work. Here's my code:

\\
Private Sub frm_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.SuspendLayout()

bmpQuit = New Bitmap(Application.StartupPath & "\Program Data\Quit.mpp")
bmpQuitOver = New Bitmap(Application.StartupPath & "\Program
Data\QuitOver.mpp")
bmpQuitDown = New Bitmap(Application.StartupPath & "\Program
Data\QuitDown.mpp")

bmpBackdrop = New Bitmap(Application.StartupPath & "\Program
Data\Backdrop.mpp")
pbxCover.Image = New Bitmap(Application.StartupPath & "\Program
Data\Backdrop.mpp")
pnlBackdrop.BackgroundImage = Bitmap.FromFile(Application.StartupPath &
"\Program Data\Backdrop.mpp")
btnQuit.Image = bmpQuit

pbxTimer.Image = ShortClock(MaxSeconds) 'ShortClock() IS AN
ARRAY OF BITMAPS, LOADED PRIOR TO

'SHOWING THE FORM

Select Case CurStudent("MF_Problems").ToString
Case "Addition"
pnlFlashCard.BackgroundImage = FlashCard(1) 'FlashCard() IS A
BITMAP ARRAY
Case "Subtraction"
'THE IMAGES ARE LOADED PRIOR TO SHOWING THE FORM
pnlFlashCard.BackgroundImage = FlashCard(2)
Case "Multiplication"
pnlFlashCard.BackgroundImage = FlashCard(3)
End Select

Me.ResumeLayout()
End Sub
\\

"Imran Koradia" <no****@microsoft.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl...
Nathan,

you could try using Me.SuspendLayout() before you start loading all your
child controls and pictures and then call Me.ResumeLayout() after you've
finished loading all of them.

hope this helps..
Imran.

"Nathan" <nk*********************@softhome.net> wrote in message
news:Oy**************@TK2MSFTNGP11.phx.gbl...
Hi,

I have a project with various forms that each include a number of picture boxes and panels with background images. When these forms first load,

they
kind of load in "pieces", with the pictures coming to view consecutively, even on a 1.6 Ghz processor with 512 MB RAM. The pictures are loaded in

the
Form_Load event. Is there a way for them to all load perfectly before the user sees the form?

Thanks,
Nathan


Nov 21 '05 #3

P: n/a
Nathan,

Unfortunately I'm not too good with GDI+. However, here is a technique I
found on MSDN that might help:
http://msdn.microsoft.com/library/de...classtopic.asp
(look at the double buffering flag)

Here's an article that could help you using this technique and in general
how to improve graphic performance:
http://www.bobpowell.net/doublebuffer.htm

here's a discussion that might help as well:
http://tinyurl.com/469ne

hope this helps..
Imran.

"Nathan" <nk*********************@softhome.net> wrote in message
news:Op**************@TK2MSFTNGP11.phx.gbl...
Thanks for the suggestion. I tried it but it didn't work. Here's my code:

\\
Private Sub frm_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.SuspendLayout()

bmpQuit = New Bitmap(Application.StartupPath & "\Program
Data\Quit.mpp")
bmpQuitOver = New Bitmap(Application.StartupPath & "\Program
Data\QuitOver.mpp")
bmpQuitDown = New Bitmap(Application.StartupPath & "\Program
Data\QuitDown.mpp")

bmpBackdrop = New Bitmap(Application.StartupPath & "\Program
Data\Backdrop.mpp")
pbxCover.Image = New Bitmap(Application.StartupPath & "\Program
Data\Backdrop.mpp")
pnlBackdrop.BackgroundImage = Bitmap.FromFile(Application.StartupPath &
"\Program Data\Backdrop.mpp")
btnQuit.Image = bmpQuit

pbxTimer.Image = ShortClock(MaxSeconds) 'ShortClock() IS
AN
ARRAY OF BITMAPS, LOADED PRIOR TO

'SHOWING THE FORM

Select Case CurStudent("MF_Problems").ToString
Case "Addition"
pnlFlashCard.BackgroundImage = FlashCard(1) 'FlashCard() IS A
BITMAP ARRAY
Case "Subtraction"
'THE IMAGES ARE LOADED PRIOR TO SHOWING THE FORM
pnlFlashCard.BackgroundImage = FlashCard(2)
Case "Multiplication"
pnlFlashCard.BackgroundImage = FlashCard(3)
End Select

Me.ResumeLayout()
End Sub
\\

"Imran Koradia" <no****@microsoft.com> wrote in message
news:ef**************@TK2MSFTNGP10.phx.gbl...
Nathan,

you could try using Me.SuspendLayout() before you start loading all your
child controls and pictures and then call Me.ResumeLayout() after you've
finished loading all of them.

hope this helps..
Imran.

"Nathan" <nk*********************@softhome.net> wrote in message
news:Oy**************@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> I have a project with various forms that each include a number of picture > boxes and panels with background images. When these forms first load,

they
> kind of load in "pieces", with the pictures coming to view consecutively, > even on a 1.6 Ghz processor with 512 MB RAM. The pictures are loaded
> in

the
> Form_Load event. Is there a way for them to all load perfectly before the > user sees the form?
>
> Thanks,
> Nathan
>
>



Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.