473,397 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How Microsoft does it?

Dear All,

I am creating a Image Library and want to know what can the best and
standard procedure to do this.

Concept is to have all the images needed by all projects (dlls and
exes) in the product at a central place (in a single DLL) making it
easy to distribute and maintain.

There are 2 ways of doing this.
1) Creating a new project, add all the images to it using "Add Existing
Item" and set Build Action=Embeded Resource for each image.
OR
2) Creating a new project>Add new Item>Resources File and then adding
all the images to it and setting Build Action=Embeded Resource for each
image. Doing this will provide me a strongly typed DLL which will
provide a property like access to all images. But .resx are mainly for
localization. And here I am not localizing images.

My question is what is the standard way of doing this?
Do you guys know pros or cons of any of these methods?
Is anybody there knowing how Microsoft do it??? (When they need to
create an image library)
Any links or articles for this?
Most important is, will the second (2) way will have any negative
effect on start up time?

Regards,
----------------------------------------------------------------------------------
Jayvardhan Patil.

Aug 30 '06 #1
2 986
First of all, if you images are large bmp's you'll be adding a lot of extra
size to you applications unless you use most of the bitmaps in all of your
app's. However, if I were to do this, I would:

Create a Class Library entitled "myImages" or something like that;

To that class library, add all the images and make each one embedded.

In the Class "myImages" create a function to return the image you want
depending on some code or better yet, an enumeration.

You can then add this class library to all of your applications.

--
Dennis in Houston
"JayvardhanPune" wrote:
Dear All,

I am creating a Image Library and want to know what can the best and
standard procedure to do this.

Concept is to have all the images needed by all projects (dlls and
exes) in the product at a central place (in a single DLL) making it
easy to distribute and maintain.

There are 2 ways of doing this.
1) Creating a new project, add all the images to it using "Add Existing
Item" and set Build Action=Embeded Resource for each image.
OR
2) Creating a new project>Add new Item>Resources File and then adding
all the images to it and setting Build Action=Embeded Resource for each
image. Doing this will provide me a strongly typed DLL which will
provide a property like access to all images. But .resx are mainly for
localization. And here I am not localizing images.

My question is what is the standard way of doing this?
Do you guys know pros or cons of any of these methods?
Is anybody there knowing how Microsoft do it??? (When they need to
create an image library)
Any links or articles for this?
Most important is, will the second (2) way will have any negative
effect on start up time?

Regards,
----------------------------------------------------------------------------------
Jayvardhan Patil.

Aug 30 '06 #2
Thanks Dennis for replying.

The solution you gave, already gets impleted automatically when you add
a resource file. (I am using VS2005 and .NET2.0) A
ResourceFileName.Designer.cs file gets created with the resource file
which provides all the coding support you are talking about using
ResourceManager class.

Thanks again for showing interest in my problem.
Dennis wrote:
First of all, if you images are large bmp's you'll be adding a lot of extra
size to you applications unless you use most of the bitmaps in all of your
app's. However, if I were to do this, I would:

Create a Class Library entitled "myImages" or something like that;

To that class library, add all the images and make each one embedded.

In the Class "myImages" create a function to return the image you want
depending on some code or better yet, an enumeration.

You can then add this class library to all of your applications.

--
Dennis in Houston
"JayvardhanPune" wrote:
Dear All,

I am creating a Image Library and want to know what can the best and
standard procedure to do this.

Concept is to have all the images needed by all projects (dlls and
exes) in the product at a central place (in a single DLL) making it
easy to distribute and maintain.

There are 2 ways of doing this.
1) Creating a new project, add all the images to it using "Add Existing
Item" and set Build Action=Embeded Resource for each image.
OR
2) Creating a new project>Add new Item>Resources File and then adding
all the images to it and setting Build Action=Embeded Resource for each
image. Doing this will provide me a strongly typed DLL which will
provide a property like access to all images. But .resx are mainly for
localization. And here I am not localizing images.

My question is what is the standard way of doing this?
Do you guys know pros or cons of any of these methods?
Is anybody there knowing how Microsoft do it??? (When they need to
create an image library)
Any links or articles for this?
Most important is, will the second (2) way will have any negative
effect on start up time?

Regards,
----------------------------------------------------------------------------------
Jayvardhan Patil.
Sep 5 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: George Hester | last post by:
You know there is a difference between the Microsoft .NET Framework and the Microsoft .NET Framework SDK. Besides the fact that the former is 20 some MB and the latter is some 100MB there is a...
1
by: Novice | last post by:
Hi all, I am a C++ and Java developer with over 3 years of industry experience. I've written low level C++ code, in addition to web clients that use web services. I've just recently installed the...
1
by: Novice | last post by:
Hi all, I'm afraid this is the second posting of this information as I didn't get a response on the previous post. I will try to shorten my message (i.e. be more concise) in the hopes that it will...
99
by: Jim Hubbard | last post by:
It seems that Microsoft not only does not need the classic Visual Basic developer army (the largest army of developers the world has ever seen), but now they don't need ANY Windows developer at a...
476
by: Xah Lee | last post by:
Microsoft Hatred, FAQ Xah Lee, 20020518 Question: U.S. Judges are not morons, and quite a few others are not morons. They find MS guilty, so it must be true. Answer: so did the German...
5
by: Niklas Uhlin | last post by:
Someone please explain why Session_Start fires multiple times / retains SessionID values between sessions, when you open an ASP.NET page from MS Word. For details of the problem, see below: 1....
182
by: Jim Hubbard | last post by:
http://www.eweek.com/article2/0,1759,1774642,00.asp
5
by: Daniel | last post by:
where does Microsoft.Xml.Xquery live? where does Microsoft.Xml.Xquery live? all i can find is a copy of it in the sample project:...
8
by: Dave | last post by:
I'm trying to import Microsoft.VisualBasic to use the IsNumeric function in my C# code but all I see is: Microsoft.VisualBasic.VBCodeProvider while using Intellisense... From samples shouldn't...
14
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
I've been searching everywhere online to find an alternative method besides using Microsoft.XMLHTTP (as it freezes the server up alot!!) but with no luck at all. I am using server side ASP, and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.