ImageList into a PictureBox 
Author Message
 ImageList into a PictureBox

Can someone show me an example of how to output an ImageList  into the
PictureBox Control?  I want the PictureBox to show a list of the images in
the ImageList vertically, or horizontal. Or is this possible?

Regards,

Knowledge

--
Jesus Christ is Lord



Sat, 04 Aug 2001 03:00:00 GMT  
 ImageList into a PictureBox
Hi Knowledge, try the following:

Private Sub Command1_Click()
       Dim i As Integer
       With Picture1
       .AutoRedraw = True
       .ScaleMode = vbPixels
       End With

       With ImageList1
           For i = 1 To .ListImages.Count
               Picture1.PaintPicture .ListImages(i).Picture, 0, i *
.ImageHeight
           Next
       End With
End Sub

'----------
galen

Quote:
>Can someone show me an example of how to output an ImageList  into the
>PictureBox Control?  I want the PictureBox to show a list of the images in
>the ImageList vertically, or horizontal. Or is this possible?

>Regards,

>Knowledge

>--
>Jesus Christ is Lord



Sat, 04 Aug 2001 03:00:00 GMT  
 ImageList into a PictureBox
Yes! You will need two PictureBoxes and one ImageList on you form. Picture1 is
the PictureBox in which the images are drawn. Picture2 is a picture for
temporary storage of images in ImageList1. The following is all the code you
need:

    Dim X As Single
    Dim Y As Single
    Dim lop As Integer

    For lop = 1 To ImageList1.ListImages.Count
        Picture2.Picture = ImageList1.ListImages(lop).Picture
        Picture1.PaintPicture Picture2.Picture, X, Y
        ' For vertical presenting use:
        Y = Y + ImageList1.ImageHeight * Screen.TwipsPerPixelY
        ' For horizontal presenting use:
        ' X = X + ImageList1.ImageWidth * Screen.TwipsPerPixelX
    Next

Make sure that Picture1.AutoRedraw = True.

Hope this helps,

Regards,
Henrik Grotle
N-6800 F?rde, Norway


Software developer VB4, RPG, HTML, Perl

To reply to this posting please remove nospam. from the e-mail adress.
Knowledge skrev i meldingen ...

Quote:
>Can someone show me an example of how to output an ImageList  into the
>PictureBox Control?  I want the PictureBox to show a list of the images in
>the ImageList vertically, or horizontal. Or is this possible?

>Regards,

>Knowledge

>--
>Jesus Christ is Lord



Sun, 05 Aug 2001 03:00:00 GMT  
 ImageList into a PictureBox
Just saw Galen's reply and immediately found that this answer was better than
mine. I don't know why I wrote that you needed two PictureBoxes there is of
course no need for this. I guess I'll have to blame it on me being somewhat
sleepy in the early morning. ;)

Regards,
Henrik Grotle
N-6800 F?rde, Norway


Software developer VB4, RPG, HTML, Perl

To reply to this posting please remove nospam. from the e-mail adress.
Henrik Grotle skrev i meldingen ...



Sun, 05 Aug 2001 03:00:00 GMT  
 ImageList into a PictureBox
Galen Nickerson, thank you very much for your reply. I will try this
immediately!

Regards,

Knowledge



Sun, 05 Aug 2001 03:00:00 GMT  
 ImageList into a PictureBox
Oh, but it was the thought that counts!

Thanks sincerely for your reply!

Regards,

Knowledge

Quote:

>Just saw Galen's reply and immediately found that this answer was better
than
>mine. I don't know why I wrote that you needed two PictureBoxes there is of
>course no need for this. I guess I'll have to blame it on me being somewhat
>sleepy in the early morning. ;)

>Regards,
>Henrik Grotle
>N-6800 F?rde, Norway


>Software developer VB4, RPG, HTML, Perl

>To reply to this posting please remove nospam. from the e-mail adress.
>Henrik Grotle skrev i meldingen ...



Sun, 05 Aug 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. assign an image from an imagelist to a picturebox

2. vb 6.0: picturebox.picture in imagelist

3. Clearing Picturebox - Picture loaded with ImageList

4. Imagelist, picturebox and BitBlt

5. Populating an imagelist from an existing imagelist?

6. How: ImageList to System ImageList???

7. Help!! Loading PictureBox FromStream and PictureBox.Image.Save

8. Best way to preview a font in a PictureBox (WAS: Question on Picturebox or an alternative)

9. copying a modified picturebox into a new picturebox

10. Copy picturebox to another picturebox

11. PictureBox inside PictureBox...

12. Best way to preview a font in a PictureBox (WAS: Question on Picturebox or an alternative)

 

 
Powered by phpBB® Forum Software