开发者

How can i show picture in Picture component in Visual Basic

How can i show picture in Picture component in Visual Basic. if the picture is lying in this directory D:\myPictures\flowe开发者_JAVA百科rs.jpg


Use LoadPicture to load your image into the PictureBox.

Picture1.Picture = LoadPicture("D:\myPictures\flowers.jpg")


in vb2010

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load PictureBox1.Image = Image.FromFile(Application.StartupPath & "\1.jpg") End Sub


You can use Windows® Image Acquisition Automation Library v2.0 Tool: Image acquisition and manipulation component for VB and scripting (XP SP1 or later, already in Vista and Win7) which can load, convert, manipulate, and save PNG, TIFF, JPG, GIF, and BMP.


You can also use CommonDialog to add the picture in runtime.In a sub wtite

commondialog1.showOpen

Picture1.Picture = LoadPicture(commondialog1.FileName)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜