huda_qadura
asked on
fill listbox with images
hi
how can i fill a listbox with image items instead of text in c#? i've seen listboxes filles with images before.
huda
how can i fill a listbox with image items instead of text in c#? i've seen listboxes filles with images before.
huda
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
// Open Image and return it - does not change size,etc.
public Image openImage(string path)
{
try
{
Bitmap bmp = new Bitmap(path);
m_img = (Image)bmp;
return m_img;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message
return (Image)null;
}
}
public void resizeImage(Image src_image,ref Image newImg,Size size)
{
Bitmap bitmap = new Bitmap(size.Width, size.Height,src_image.Pixe
Graphics new_g = Graphics.FromImage(bitmap)
new_g.SmoothingMode = System.Drawing.Drawing2D.S
new_g.InterpolationMode = System.Drawing.Drawing2D.I
new_g.DrawImage(src_image,
newImg = (Image)bitmap;
new_g.Dispose();
}