可以把vb 6.0的 form 或 image 或 pictuer 中
所顯示的圖形或文字 存成jpg的圖檔
或是在上述那些之中開啟一個圖片
2005-12-31 23:51:38 · 2 個解答 · 發問者 whatai 2 in 電腦與網際網路 ➔ 程式設計
可以用 LoadPicture 載入圖檔。LoadPicture FunctionSee Also ExampleLoads a graphic into a forms Picture property, a PictureBox control, or an Image control.SyntaxLoadPicture([filename], [size], [colordepth],[x,y])The LoadPicture function syntax has these parts:PartDescriptionfilenameOptional. String expression specifying a filename. Can include folder and drive. If no filename is specified LoadPicture clears the Image or PictureBox control.sizeOptional variant. If filename is a cursor or icon file, specifies the desired image size.colordepthOptional variant. If filename is a cursor or icon file, specifies the desired color depth.xOptional variant, required if y is used. If filename is a cursor or icon file, specifies the width desired. In a file containing multiple separate images, the best possible match is used if an image of that size is not available. X and y values are only used when colordepth is set to vbLPCustom. For icon files 255 is the maximum possible value.yOptional variant, required if x is used. If filename is a cursor or icon file, specifies the height desired. In a file containing multiple separate images, the best possible match is used if an image of that size is not available. For icon files 255 is the maximum possible value.RemarksGraphics formats recognized by Visual Basic include bitmap (.bmp) files, icon (.ico) files, cursor (.cur) files, run-length encoded (.rle) files, metafile (.wmf) files, enhanced metafiles (.emf), GIF (.gif) files, and JPEG (.jpg) files.Graphics are cleared from forms, picture boxes, and image controls by assigning LoadPicture with no argument.To load graphics for display in a PictureBox control, Image control, or as the background of a form, the return value of LoadPicture must be assigned to the Picture property of the object on which the picture is displayed. For example:Set Picture = LoadPicture("PARTY.BMP")
Set Picture1.Picture = LoadPicture("PARTY.BMP")
2006-01-01 00:14:13 · answer #1 · answered by ? 7 · 0⤊ 0⤋
Private Sub Command1_Click() '載入圖片
Me.AutoRedraw = True
Me.Picture = LoadPicture("C:\Test.bmp")
Me.AutoRedraw = False
Picture1.AutoRedraw = True
Picture1 = LoadPicture("C:\Test.bmp")
Picture1.AutoRedraw = False
Image1.Image = LoadPicture("C:\Test.bmp")
End Sub
Private Sub Command2_Click() '儲存圖片
SavePicture Me.Image, "C:\Test1.bmp"
SavePicture Picture1.Image, "C:\Test1.bmp"
SavePicture Image1.Image, "C:\Test1.bmp"
End Sub
2006-01-01 11:17:47 · answer #2 · answered by W.J.S. 7 · 0⤊ 0⤋