?
Solved

Memory problems loading pictures into image list

Posted on 2004-11-21
10
Medium Priority
?
754 Views
Last Modified: 2013-12-25
I am having problems inserting pictures into my image list for use on buttons in the toolbar. First of all the images were not showing on the buttons when I referenced the image list in the customise toolbar dialog box and now when I try to insert a pictures its telling me I am "Out of Memory"

Any ideas?

Gavin

0
Comment
Question by:Gavin_Stafford
  • 4
  • 3
  • 3
10 Comments
 
LVL 6

Expert Comment

by:mmusante
ID: 12642450
I had similar problems ... try using your images as resources (with the resource editor) instead of using image-list

If you use your images in several forms you can try unloading them when the form is not active (working with the from activate deactivate events)
0
 

Author Comment

by:Gavin_Stafford
ID: 12642854
Thank you for the quick response. Could you just explain how to use the resource editor I am from the UK and I'm a bit thick

Gavin
0
 
LVL 6

Expert Comment

by:mmusante
ID: 12642898
Resource editor is a VB Add-In you can simply activate it from the add-In Menu (sorry but I use a localized version of VB so I can't give you the full english-menu path). Once activated you can add images in Resouce editor simply clicking in the 'bitmap' icon, every picture you add will have a id number

To use resources images use this code ...

Set cmdCommand.Picture = LoadResPicture(104, vbResBitmap)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:mmusante
ID: 12642955
Sorry but I verified just now that the toolbar control seems only work with Imagelist (the button object only accept the Imagelist key as property and not a picture object) so if you want use this control you'll need e different solution ...
0
 

Author Comment

by:Gavin_Stafford
ID: 12643073
Thanks for your help this far. I'lluse resource file for my other pics.

Anyone got any other ideas?
0
 
LVL 17

Expert Comment

by:zzzzzooc
ID: 12643091
>>when I referenced the image list in the customise toolbar dialog box
When you configure your buttons, you also have to select the image's index to use for a partilcular button.

>>its telling me I am "Out of Memory"
If the problem still occurs when you restart Windows or VB, try updating to the latest (6.0 is fine).
0
 

Author Comment

by:Gavin_Stafford
ID: 12643111
Thank you.

I'll try the first part

But I'm allready running VB 6 so I'm a bit confused.
0
 
LVL 17

Accepted Solution

by:
zzzzzooc earned 500 total points
ID: 12643169
Oh, I meant the version of the control (MS Common Controls 6.0). Do you have this problem with every type of image? It could just be the images you're trying to use.
0
 

Author Comment

by:Gavin_Stafford
ID: 12643187
Dear zzzooocc

It worked

I was using version 5 of common controls. I changed to six and it worked

If you were here I would hug you

Gavin
0
 
LVL 17

Expert Comment

by:zzzzzooc
ID: 12643201
:)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question