|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How Microsoft does it?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. 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. -- Show quoteHide quoteDennis 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. > > 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: Show quoteHide quote > 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. > > > >
Concurrency violation at update
How to use this service ??? WSDL available A Service in VB.NET 2005 using a form ? How to dynamically instantiate a base calss (w/ args to constructor?) Listview deselect all Where can we buy VB.net? do event Date/Time problem No equivalent control VB6 to VB.Net ActiveX Document DLL (VBD) Inquiry... |
|||||||||||||||||||||||