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

C# 2005 : How can I add image to image list dynamically

487 Expert 256MB
Can any one point me how I can add images to image list control (dynamically through code)?
Oct 9 '07 #1
4 4566
Plater
7,872 Expert 4TB
MSDN would answer your question imediatly.
So would the intelisense if you bothered to look:
Expand|Select|Wrap|Line Numbers
  1. ImageList myimagelist = new ImageList();
  2. Image myimg = Image.FromFile(filename);
  3. myimagelist.Images.Add(myimg);
  4.  
Oct 9 '07 #2
CyberSoftHari
487 Expert 256MB
Thank you, and can any one point me to draw images from Image list to picture control?
Below is code i tried...
Expand|Select|Wrap|Line Numbers
  1.  
  2.   Graphics g = picShow.CreateGraphics(); 
  3.    addImage(); // Here i am loding images to Image list
  4.    imgLstSample.Draw(g, 1,1, 1);
  5.  
I cannot view any images and also there is no error.
Oct 9 '07 #3
Plater
7,872 Expert 4TB
Uhhh... what was that?
A picture control houls have a "Image" or "backgroundImage" property of some sort that you can just assign from the index of the imagelist (actually I think they will take an entire imagelist and you can pick)
Oct 9 '07 #4
CyberSoftHari
487 Expert 256MB
Okay, I did it.
Expand|Select|Wrap|Line Numbers
  1. MyPicControl.Image = (Bitmap)MyImageListControl.Images[0];
Thank you Plater.
Oct 10 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Laszlo Zsolt Nagy | last post by:
Hello, How can I determine the number of colors used in an image? I tried to search on Google but I could figure out. I read the PIL handbook but I do not see how to do it. Can anyone help? ...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
0
by: Benny Raymond | last post by:
Does anyone know a way to dynamically update an image list - in case an image changes for a tool bar or something and you want it to build in the new images each time. Currently if an image...
5
by: Glen Richards | last post by:
I've had no success in trying to dynamically set images at runtime in a Crystal Reports 9 report using C# 2005 Beta. I've been doing research along these lines & all the posts I've read say this...
6
by: Rick Brandt | last post by:
I have a list of dynamically generated Parts that can be used to add to an Order. The list includes an image with the src set to "WhateverThePartNumberIs.png" in a particular folder. Not all...
5
by: Jeff | last post by:
Hey asp.net 2.0 I have a webpage which generate thumbnail images. In another webpage I want to display these images... I tryed using this solution: <img ID="photo"...
3
by: Nathan Sokalski | last post by:
I am using ASP.NET, VB.NET, and GDI+ to dynamically create images for webpages. When I right-click on the dynamically created image to try to save it to my hard drive, which I send as...
45
by: mistral | last post by:
Does Visual C++ 2005 Express Edition produce small, compact C executables? Or there is another C compilers that do this better? m.
12
benchpolo
by: benchpolo | last post by:
I have a group of 20 images (.jpg) formats that I want to incorporate with my new access database that will dynamically display the image on the form based on the value that I select from the...
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
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:
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,...

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.