Dynamically Adding Images

  • Thread starter Thread starter Jeff Johnson
  • Start date Start date
J

Jeff Johnson

I'm trying to dynamically add images and set their background colour with
hexidecimal values that are being returned in an array.

I'm using this to declare the images:

System.Web.UI.WebControls.Image imgImage = new
System.Web.UI.WebControls.Image();



Is there a better way to declare them?

I'm also getting an error (cannot implicity convert type 'string' to
'System.Drawing.Color') when I try to set the BackColor attribute.

Would someone please provide some insight on how to get past this obstacle.

Many thanks,

Jeff
 
Jeff Johnson said:
I'm also getting an error (cannot implicity convert type
'string' to 'System.Drawing.Color') when I try to set
the BackColor attribute.

BackColor is not a string property. To convert HTML-style hexadecimal
colour codes to Color objects, use the WebColorConverter class.

P.
 
Back
Top