473,395 Members | 1,869 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,395 software developers and data experts.

Large app, many icons how to manage

We are migrating a large app to .net. There are many forms and there will
be many, many icons.

What are some suggested techniques for more or less sharing imagelists (easy
enough), BUT without giving up the design time experience.

jeff
Oct 12 '07 #1
3 1693
On Oct 12, 10:47 pm, "Jeff Jarrell" <jjarrel_NOS...@yahoo.comwrote:
We are migrating a large app to .net. There are many forms and there will
be many, many icons.

What are some suggested techniques for more or less sharing imagelists (easy
enough), BUT without giving up the design time experience.

jeff
I don't know how large is your app, and I don't know how many icons
you are using. But with my current project, I compile more than 1400
jpeg icons at size 32*32 into a dll as resources, and splite them into
two ImageList (identify each by its file name), and the result is
nearly perfect, although it's a little slower (1-3 seconds than not
using icons) at creating the ImageList instance for the first time.
So I guess maybe this works for you.

Oct 12 '07 #2
Sounds interesting. This seems like a fair comparison in terms of size.

Let me get clear on the workflow. Add a resource file the project, then add
images to the resource file. Then how does it get assembled into the
imagelist? And do you still have design time support? You have an article
you could point me to for the technique.

Thanks,

jeff

"deerchao" <de******@gmail.comwrote in message
news:11**********************@v23g2000prn.googlegr oups.com...
On Oct 12, 10:47 pm, "Jeff Jarrell" <jjarrel_NOS...@yahoo.comwrote:
>We are migrating a large app to .net. There are many forms and there
will
be many, many icons.

What are some suggested techniques for more or less sharing imagelists
(easy
enough), BUT without giving up the design time experience.

jeff

I don't know how large is your app, and I don't know how many icons
you are using. But with my current project, I compile more than 1400
jpeg icons at size 32*32 into a dll as resources, and splite them into
two ImageList (identify each by its file name), and the result is
nearly perfect, although it's a little slower (1-3 seconds than not
using icons) at creating the ImageList instance for the first time.
So I guess maybe this works for you.

Oct 12 '07 #3
On Oct 13, 3:55 am, "Jeff Jarrell" <jjarrel_NOS...@yahoo.comwrote:
Sounds interesting. This seems like a fair comparison in terms of size.

Let me get clear on the workflow. Add a resource file the project, then add
images to the resource file. Then how does it get assembled into the
imagelist? And do you still have design time support? You have an article
you could point me to for the technique.

Thanks,

jeff

"deerchao" <deerc...@gmail.comwrote in message

news:11**********************@v23g2000prn.googlegr oups.com...
On Oct 12, 10:47 pm, "Jeff Jarrell" <jjarrel_NOS...@yahoo.comwrote:
We are migrating a large app to .net. There are many forms and there
will
be many, many icons.
What are some suggested techniques for more or less sharing imagelists
(easy
enough), BUT without giving up the design time experience.
jeff
I don't know how large is your app, and I don't know how many icons
you are using. But with my current project, I compile more than 1400
jpeg icons at size 32*32 into a dll as resources, and splite them into
two ImageList (identify each by its file name), and the result is
nearly perfect, although it's a little slower (1-3 seconds than not
using icons) at creating the ImageList instance for the first time.
So I guess maybe this works for you.
I don't use resource files, it's a little harder to get along with. I
just create a new library project, and add these 1400+ files into it,
then set their "Build Action" to "Embedded Resource". And I created a
class IconsManager in this project too. Here is some code from this
class:

private static ImageList meleeImageList;
static ImageList MeleeImageList
{
get
{
if (meleeImageList == null)
{
meleeImageList = new ImageList();
Assembly asmb =
Assembly.GetAssembly(typeof(IconsManager));
string[] resources =
asmb.GetManifestResourceNames();
foreach (string resource in resources)
{
if
(resource.StartsWith("Deerchao.War3Share.Client.Ic ons.Melee."))
{
using (Stream stream =
asmb.GetManifestResourceStream(resource))
{
Bitmap bmp = Bitmap.FromStream(stream)
as Bitmap;
meleeImageList.Images.Add(resource,
bmp);
}
}
}
}
return meleeImageList;
}
}

public static ImageList GetImageList()
{
return MeleeImageList;
}

public static string GetImageKey(string itemName)
{
return
string.Format("Deerchao.War3Share.Client.Icons.Mel ee.{0}.jpg",
itemName);
}

As for design time support, sorry, there isn't any. To asign an icon
to a control, I have to use code, so I can see these icons only at run
time. This is what I do:

protected override OnLoad(...)
{
listView1.SmallImageList=IconsManager.GetImageList ();
}

ListViewItem item=...;
item.ImageKey=IconsManager.GetImageKey("xxxx");

Hope this helps.

Oct 13 '07 #4

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

Similar topics

36
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but...
3
by: DOK | last post by:
I'm creating an ad for eBay and want to keep the page condensed. I have 6 images - different views of an antique lap steel guitar - that need to show superb detail. I have cropped the images to...
4
by: HankD | last post by:
I have been given the task to upgrade the company's website. It is large and unorganized right now. There should be a main common area with subareas for each division (5). My main question is what...
1
by: Richard | last post by:
If I'm to make a Listview with a list of files, then how can i get the associated icon to match the file?? Meaning I need the Windows Explorer icons to be the same as in my listview. I can...
0
by: ljlevend | last post by:
I want to set the client size of a ListView control so that it is just wide enough to contain 2 columns of large icons plus enough space for the vertical scrollbar. I know that...
0
by: uv507 | last post by:
Hello, I have found a way to easily reorder rows of my listview. But it only works in small icons mode. When I do my reordering (drag and drop in my own list) in large icons mode, the item that...
3
by: Dan Munk | last post by:
Hello, I am working on a very large multi-tier Web application. The application consists of approximately 100 middle-tier/back-end projects and 200-300 presentation projects. Obviously this is...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
1
by: Nilam2477 | last post by:
I need to use SHGetFileInfo to display large icons.For small icon display it works fine. If i change the parameter to display large icon it does not display the file with large icon, it always...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.