PC Review


Reply
Thread Tools Rate Thread

how to add Image array / ImageList.ImageCollection to a control?

 
 
Kristopher Wragg
Guest
Posts: n/a
 
      24th Apr 2006
Hi,

I'm creating a customized picturebox that will have an array of images
and some properties that will allow the picturebox to change its image
to one of the images in the array depending on events that it registers
for...

I'm having trouble storing an array of images though,

I've tried Image[] but this doesn't work correctly, I've tried
ImageList.ImageCollection but this doesn't save images once you've
selected them, I've tried ShouldSerialize procedure, that didn't help.

The only thing I've got to work is adding an ImageList, but I dont
particulally want that as I want customers to be able to drop a
PictureBox onto the canvas and just set the images in the property
panal, not mess around adding an ImageList etc...

any ideas?

Thanks,
Kris Wragg

 
Reply With Quote
 
 
 
 
Kris Wragg
Guest
Posts: n/a
 
      24th Apr 2006
Just to add this is what I've tried so far with no luck:

private Image[] myImages;
public Image[] MyImages
{
get { return myImages; }
set { myImages = value; }
}

this returns an error when trying to add a new image in the property grid i
recieve:

"Cannot create an instance of System.Drawing.Image because it is an abstract
class."

public ImageList.ImageCollection MyImageList
{
get { return imageList.Images; }
//set { iconList.Images = value; } // this doesn't work
}

this throws an error after selecting a new image to be added and says:
"Parameter must be of type Image. Parameter name: value"


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ImageList Component: Adjust Image Size Per Image senfo Microsoft C# .NET 2 13th Feb 2007 02:22 PM
load image control from emf in a byte array =?Utf-8?B?VGltIEJhbGV5?= Microsoft Access Form Coding 2 12th Sep 2006 03:15 PM
Set Image.Picture property to an item in a ImageList control Craig Buchanan Microsoft Access Form Coding 1 14th Dec 2004 08:38 PM
how to keep image proportions in imagelist Tim Mackey Microsoft Dot NET Framework Forms 5 26th May 2004 08:57 AM
How to expose the Image-Size-Property of an ImageList in a User Control? Jan Liße Microsoft Dot NET Framework Forms 2 10th Dec 2003 09:43 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:48 PM.