Solved

Project Images Best Practices

Posted on 2007-04-04
2
203 Views
Last Modified: 2012-05-05
Greetings experts,

I have a quick "Best Practices" type question that I hope will be an easy one to answer.  

I have a VS 2005 Windows Application that will have anywhere from 80-100 icon type images.  The average file size of these images is 1KB-3KB.   I dragged them into the project resources page and they all work fine.   However, I'm concerned as to whether or not this approach will be adding too much memory overhead.  

So my question is . . .  Given the number of images in my scenario, what is the most effecient way to make the images available to my application?  

Thank you in advance,

Keith
0
Comment
Question by:kdwood
2 Comments
 
LVL 27

Accepted Solution

by:
VBRocks earned 400 total points
Comment Utility
When you add resources to your application, they are linked by default, so no need to worry about them all being loaded into memory at once.  Here is some additional information about project resources:

Note:  For VS2005, try the following help file link:
ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.VisualStudio.v80.en/dv_vsprojopt/html/81ef0706-f495-4613-8634-f4a3a5d681b9.htm

Resources:
Items that you add to the project using the Resource Designer are placed in the Resources directory for your project. The designer information is stored in Resources.resx, and code for the resource is stored in Resources.Designer.vb

For Visual Basic, the Resource Designer generates strongly-typed resources into the My.Resources namespace.

Strongly-typed resources encapsulate access to resources by creating classes that contain a set of static, read-only (get) properties at compile time. You can consume resources using the "get" properties rather than using the GetString and GetObject methods of the ResourceManager class.

Resources also have a Persistence property that specifies whether they are linked or embedded. Linked resources are stored as files within the project; the .resx file stores a relative path to the file, and during compilation, the resource data is placed into the manifest for the application.

Linked resources are stored as files within the project; during compilation the resource data is taken from the files and placed into the manifest for the application. The application's resource file (.resx) stores only a relative path or link to the file on disk.

By default, all new resources are linked resources, as opposed to embedded.

0
 
LVL 10

Author Comment

by:kdwood
Comment Utility
VBRocks,

Makes perfect sense.  I appreciate the clear explanation.

Thank you for your quick response,

Regards,

Keith
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now