Re: Wierd ImageList behavior

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Harry Simpson (hssimpson_at_nospamphgt.net)
Date: 04/28/04


Date: Wed, 28 Apr 2004 16:55:51 -0500


Refreshing when you can answer your own questions.....

Seems the ImageList default size is 16,16 So everything coming out of it is 16,16
So when i say PictureBox1.Image = ImageList1.Images(0) , the image i'm grabbing is a 16x16 image even though the original picture was 41x41.

Only way around this is to set the ImageList ImageSize to whatever you want the picture to be displayed as (ie 41,41)

Thanks
Harry

  "Harry Simpson" <hssimpson@nospamphgt.net> wrote in message news:edW3LcWLEHA.1192@TK2MSFTNGP11.phx.gbl...
  a. Below the image displays just fine in the picturebox (41x41 in a 41x41 picturebox)
  b. Add From ImageList button is clicked w/ the following code:
          Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
              PictureBox1.Image = ImageList1.Images(0)
          End Sub
  And i get the small image which is much smaller.
  c. If i change the sizemode from normal to stretchimage, it distorts the image when i load it from the imagelist.

  This is got to be a bug right in the control?

  Thanks,
  Harry

  "Harry Simpson" <hssimpson@nospamphgt.net> wrote in message news:egPZnBWLEHA.3712@TK2MSFTNGP11.phx.gbl...
> I've added five 41x41 pixel bitmaps to an ImageList. I then
> programmatically add different pictures from the imagelist into picture
> controls which too are 41x41.
>
> Setting the image propertyy for the pictureboxes works great at design time
> but during run time, the images are shrunken to 16x16 pixels before they
> appear. If I set the "shrink" they expand but are distorted as if they
> really are 16x16 pictures.
>
> Any idea what could be causing this?
>
> TIAM,
>
> Harry
>
>






Relevant Pages

  • Re: A thousand dollars for food per month? WOW!!
    ... So, in order to get a $1.00 per gallon discount, you must spend ... Harry takes in strays when he's not busy being clever and articulate. ... he INSTANTLY posted a picture of the software in action? ... the picture of the "server" running was a photoshop job.. ...
    (rec.boats)
  • Re: OT: A 1.6 TB (thats right, TB) storage/playback disk is coming your way
    ... Harry, ... doctor the test, and post a picture of the results it would be very easy to ... Or more like you saying you don't discuss ...
    (rec.boats)
  • Re: Favor please...
    ... I won't blame you - or Harry. ... I asked about your experience with ocean-capable boats. ... Now show me something you have built, or a picture of your Zimmerman ... Stick to Google ...
    (rec.boats)
  • Re: A thousand dollars for food per month? WOW!!
    ... So, in order to get a $1.00 per gallon discount, you must spend ... Harry takes in strays when he's not busy being clever and articulate. ... than your uneducated, ill-informed opinions. ... he INSTANTLY posted a picture of the software in action? ...
    (rec.boats)
  • Re: Fun morning
    ... The Skipper - Harry thing was funny. ... There was always the exaggerations and tall tales, not that Skipper was any better. ... There was also the perfect storm picture someone else did with Harry and Skipper in a Bayliner. ...
    (rec.boats)