Results 1 to 2 of 2

Thread: Displaying .png graphics in picturebox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2005
    Posts
    119

    Displaying .png graphics in picturebox

    Hi guys, have a problem here.I just need my Loadpicture() to be able to display .png pictures...is there a standard short code which i can just put in in front of my Loadpicture command?

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jan 2005
    Posts
    119

    Re: Displaying .png graphics in picturebox

    This is my code for displaying the picture,

    'Create picturebox for graphical result
    Set imgBOX.Picture = LoadPicture("C:\Documents and Settings\vb.jpg")

    PicBOX.AutoRedraw = True
    scrVERT.Max = ScaleY(imgBOX.Picture.Height, vbHimetric, vbPixels) - ScaleY(PicBOX.ScaleHeight, vbTwips, vbPixels)
    scrHOR.Max = ScaleX(imgBOX.Picture.Width, vbHimetric, vbPixels) - ScaleX(PicBOX.ScaleWidth, vbTwips, vbPixels)

    'just setting these to larger values to have faster scroll
    scrVERT.SmallChange = 50
    scrVERT.LargeChange = 100
    scrHOR.SmallChange = 50
    scrHOR.LargeChange = 100

    'paint the top left of the picture to the size of the picture box
    PicBOX.PaintPicture imgBOX.Picture, 0, 0, PicBOX.ScaleWidth, PicBOX.ScaleHeight, 0, 0, PicBOX.ScaleWidth, PicBOX.ScaleHeight



    How do I modify this so that instead of vb.jpg I cna load vb.png?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width