images in arrays..

  • Thread starter Thread starter Maheshkumar.R
  • Start date Start date
M

Maheshkumar.R

How i can store images in array @ runtime..? What are the possbile ways..

Thankz..
-
Mähésh Kumär. R
 
ArrayList myImages = new ArrayList();
myImages.Add ( image1 );
myImages.Add ( image2 );
myImages.Add ( image3 );

// where image# is an image object variable


How i can store images in array @ runtime..? What are the possbile ways..

Thankz..
-
Mähésh Kumär. R
 
Thnkz Bass, again i struck in adding images to listview controls,

........function (string[] fname)

{

mycontrol.filename = fname.ToString(); // image filename assigned to my control

a = mycontrol.copyImage2Clipboard; // and also taking first frame of that image for thumbnail generation

Bitmap bmp= new Bitmap(Clipboard.GetImage());

listView2.Items.Add(fname); // Here i'm adding filenames to the list control, but i want to add image to the list control..how can i do this ..please guide

...

..

..}

..

How can i add an image to the list view control in this scenario..?

Maheshkumar.R

"Dan Bass" <Not Listed> wrote in message
ArrayList myImages = new ArrayList();
myImages.Add ( image1 );
myImages.Add ( image2 );
myImages.Add ( image3 );

// where image# is an image object variable


How i can store images in array @ runtime..? What are the possbile ways..

Thankz..
-
Mähésh Kumär. R
 
Thnkz Bass, again i struck in adding images to listview controls,

.......function (string[] fname)

{

mycontrol.filename = fname.ToString(); // image filename assigned to my control

a = mycontrol.copyImage2Clipboard; // and also taking first frame of that image for thumbnail generation

Bitmap bmp= new Bitmap(Clipboard.GetImage());

listView2.Items.Add(fname); // Here i'm adding filenames to the list control, but i want to add image to the list control..how can i do this ..please guide



Make a class which will map bitmap with its name, and override ToString() method:

listView2.Items.Add(new BitmapNameMap(bmp, fname));

////

class BitmapNameMap {

public BitmapNameMap(Bitmap bmp, string name) {

m_bmp = bmp;m_mane = name;

}

public override ToString() { return m_name; }

public Bitmap Bitmap {

get { return m_bmp; }

}

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top