|
-
Jun 6th, 2000, 09:24 PM
#1
Thread Starter
Hyperactive Member
Hi, I need to dynamically refresh a number of image controls with different images. From a performance standpoint, I should be using something like an imagelist, but MS says that an imagelist is only for ListView, TreeView, TabStrip, and Toolbar controls. So is there something more efficient than loadpicture("i:\Application Components\Workflows\TmEntry.gif") each time a different image is needed? Any way of loading the images just once and keeping them in memory for reuse?
Thanks in advance.
-
Jun 6th, 2000, 09:53 PM
#2
Frenzied Member
Code:
Dim MyPict As StdPicture
Set MyPict = LoadPictureApp.Path & "\MyBitmap.bmp")
if MyPict is a global variable then you can just go
Code:
Set Picture1.Picture = MyPict
whenever you like, even if you set picture1.picture = nothing you still have the picture stored in MyPicture
-
Jun 6th, 2000, 09:59 PM
#3
Frenzied Member
you can use an image list for other things
eg:
Code:
Image1.Picture = ImageList1.ListImages(1).Picture
you compile all your images into a resource file and retrieve them when required.
-
Jun 6th, 2000, 10:02 PM
#4
Junior Member
Yes, you can load pictures once by placing them all in an
imagelist control say, Img1. Then, when accessing the
pictures in the imagelist control for a Picture Box use this
Picture1.picture = Img1.ListImages(<IndexOfPicture>).Picture
where:
<IndexOfPicture> = is the index number of the image stored in the imagelist control.
See? no need to use the LoadPicture function. Hope this helps....
-
Jun 6th, 2000, 10:04 PM
#5
Thread Starter
Hyperactive Member
Thank you all That'll make life easier.
-
Jun 7th, 2000, 08:41 AM
#6
PowerPoster
Resource File
May be you can add all you image into a Resource File and then just pull each image anytime when you need it.
Code:
LoadResPicture(index, format)
Where index is your image ID under the Res file and Format is the tyoe of data that you will to retrieve from the Res file.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|