loading images from an imagelist control

  • Thread starter Thread starter Scott Baxter
  • Start date Start date
S

Scott Baxter

Hello,

Using the default splash screen provided in vb.net, a bitmap is displayed in
the background.

I can manually change this in design mode, by getting the image from the
image file on disk.

If I try to do it at run time, I get a blurred image.

I know I'm missing something. Can someone show me the right way.

My file to load is a jpeg, but I have it loaded in a listimages control. I
could use bitmap, or whatever is needed.

Here's the code I tried.

MainLayoutPanel.BackgroundImage = New
System.Drawing.Bitmap(ImageList1.Images(1))

Thanks for any help.

Scott
 
Scott Baxter said:
Using the default splash screen provided in vb.net, a bitmap is displayed
in
the background.

I can manually change this in design mode, by getting the image from the
image file on disk.

If I try to do it at run time, I get a blurred image.

I know I'm missing something. Can someone show me the right way.

My file to load is a jpeg, but I have it loaded in a listimages control.
I
could use bitmap, or whatever is needed.

Here's the code I tried.

MainLayoutPanel.BackgroundImage = New
System.Drawing.Bitmap(ImageList1.Images(1))

You could assign the image directly: 'MainLayoutPanel.BackgroundImage =
ImageList1.Images(1)'. However, I suggest not to use an image list for this
purpose. Instead I'd add the image as a resource to the project ("My
Project" -> "Resources") and access the image using 'My.Resources.<resource
name>'.

Image lists are intended to store a set of images sharing certain properties
(size, color depth, ...).
 
Back
Top