473,395 Members | 1,846 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.

Creating an array of .Image types in a form?

I've created arrays of labels, linklabels and other form items but I
can't figure out how to create an array of images in a form,
dynamically. The form page will require up to 30 images to be loaded
with the urls' coming from an xml file. I parsed out the xml easily
enough but I hope that I dont have to create 30 separate images. There
has to be a way to create an array of images.

Any ideas?
Nov 15 '05 #1
2 20189
Hi Greg,

Please correct me if I have not understood your question correctly.

I assume you need to create an array of System.Drawing.Image objects
on the fly from a set of file path names that you have extracted
from an XML document. You can try something like the following:

String[] imageFilePaths;

// Let's assume imageFilePaths contains the file paths to the images
// that are extracted from your XML document
// Populate imageFilePaths array here from the XML doc.....

// Create an array of images
Image[] images = new Image[30];
for(int index = 0; index < 30; index++)
{
images[index] = Image.FromFile(imageFilePaths[index]);
}
Regards,
Aravind C
"Greg Merideth" <gm*******@removethis.uclabs.com> wrote in message
news:qI********************@comcast.com...
I've created arrays of labels, linklabels and other form items but I
can't figure out how to create an array of images in a form,
dynamically. The form page will require up to 30 images to be loaded
with the urls' coming from an xml file. I parsed out the xml easily
enough but I hope that I dont have to create 30 separate images. There
has to be a way to create an array of images.

Any ideas?

Nov 15 '05 #2
Thanks for the post. I went a little overboard from lack of sleep I
think, that solution was about 100x easier than what I was playing
around with.
Aravind C wrote:
Hi Greg,

Please correct me if I have not understood your question correctly.

I assume you need to create an array of System.Drawing.Image objects
on the fly from a set of file path names that you have extracted
from an XML document. You can try something like the following:

String[] imageFilePaths;

// Let's assume imageFilePaths contains the file paths to the images
// that are extracted from your XML document
// Populate imageFilePaths array here from the XML doc.....

// Create an array of images
Image[] images = new Image[30];
for(int index = 0; index < 30; index++)
{
images[index] = Image.FromFile(imageFilePaths[index]);
}
Regards,
Aravind C
"Greg Merideth" <gm*******@removethis.uclabs.com> wrote in message
news:qI********************@comcast.com...
I've created arrays of labels, linklabels and other form items but I
can't figure out how to create an array of images in a form,
dynamically. The form page will require up to 30 images to be loaded
with the urls' coming from an xml file. I parsed out the xml easily
enough but I hope that I dont have to create 30 separate images. There
has to be a way to create an array of images.

Any ideas?


Nov 15 '05 #3

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

Similar topics

1
by: Dave Higgins | last post by:
Can the GD library do this? I have an array of numbers (which I shall be manipulating server-side), which I wish to convert into an image. The elements of the array are essentially the 1D...
9
by: Mike | last post by:
Hello, How do I send an array from a form to another php page?I want to bundle up some data from form fields in an array and send them together like that. I must be missing something? Thanks Mike
6
by: comp.lang.php | last post by:
/** * Generate the random security image * * @access public * @param $willUseFilePath (default false) boolean to determine if you will be using a file path * @param mixed $filePath (optional)...
2
by: Darrel | last post by:
I have a working function that grabs an image from a FILE form field and get's the filename from it: imageToCheck = myFormField.postedfile checkedFileName = Mid(imageToCheck.FileName,...
1
by: john saul | last post by:
Hello All, I am not extremely new to Access but need help to hopefully a simple question. I am creating a project quote form that will ask customers questions and retreive pricing due to the...
15
by: Madhur | last post by:
Hi All, I would like you help me in creating an array of data types. I am interested in look at the the data type which looks like this Array...
2
by: Nhoung Ar | last post by:
Can anyone outhere advise me about a best practice of embedded the image into form or report. I have several forms and report which embedded images (logo) to the header. I observed that the...
8
by: libish | last post by:
hi all.., i'm new in windows mobile application... i would like to kno if there exist any way to add a background image to "form"(windows mobile). thanks in advance..
4
by: rakesh005 | last post by:
i want to save the employe image with his data in the database so i want to know how to add image in form and to save in database please send me the codes thanku
1
by: ahana | last post by:
i have got information posted from html form into a php file. i have accessed it through $_POST array. now i want to store these values in an array in numeric form but they always turn out to be...
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?
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
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...

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.