下载FormImageSave - 2.14 KB IntroductionThis是示例代码将VB 6.0的图像形式保存到一个文件中。 BackgroundNormally表单。图像属性只提供图纸和印刷 位图图像的文本。但是如果有图像控制,按钮, 图标等形式,那么这个代码的照片。 使用codeThere是一个过程SaveFormImageToFile自我explainatory。使用API BitBlt形成图像转换为...
Image1.Picture = LoadPicture(Trim(ComDialog.filename)) SourceFile = FreeFile Open Trim(ComDialog.filename) For Binary Access Read As SourceFile FileLength = LOF(SourceFile) If FileLength = 0 Then Close SourceFile Else answ = MsgBox("是否要保存当前的相片?", vbQuestion + vbOKCancel, "提示:"...
您可以使用GdipSaveImageToStream,然后将数据复制到vb数组中。
而SaveImageTo 是一组我为了方便大家 使用而 写的函 数,功能是 保存 Image/Bitmap 以一个指定格式到 一个文件 。 具体函数列 表: Public Function SaveImageToPNG(ByVal Image As Long, ByVal Path As String) As GpStatus Public Function SaveImageToJPG(ByVal Image As Long, ByVal Path As String,...
Private Sub save_Click() picturebox2.Picture = bitmap picturebox2.Picture = ("c:\\image\\image1.jpg") End sub 结束子 看答案 您需要使用 SavePicture 陈述。这可能会将您的图形保存为BMP文件,而不是像您的代码段所建议的那样作为JPG文件。 SavePicture picturebox2.picture, "filename.bmp" ...
数据库dim stm as ADODB.Streamdim rs as ADODB.Recordsetsub SavePictureToDB(cnAs ADODB.Connection)将图片存入数据库On Error GoTo EHSet stm = New ADODB.Streamrs.Open select ImagePath,ImageValue fromtbl_Image, cn, adOpenKeyset, adLockOptimisticCommonDialog1.ShowOpenText1.Text = CommonDialog1.File...
sub SavePictureToDB(cn As ADODB.Connection) '将图片存入数据库 On Error GoTo EH Set stm = New ADODB.Stream rs.Open "select ImagePath,ImageValue from tbl_Image", cn, adOpenKeyset, adLockOptimistic CommonDialog1.ShowOpen Text1.Text = CommonDialog1.FileName With stm .Type = adTypeBinary .Ope...
Public Function SaveStdPicToFile(Stdpic As StdPicture, ByVal FileName As String, _ Optional ByVal FileFormat As ImageFileFormat = Jpg, _ Optional ByVal JpgQuality As Long = 80, _ Optional Resolution As Single) As Boolean Dim CLSID(3) As Long ...
GdipLoadImageFromFile StrPtr("F:\work_vb\001.png"), Bitmap GdipDrawImageRect Graphics, Bitmap, 0, 0, 400, 400'拉伸到100*200 SaveImageToPNG Bitmap, "F:\work_vb\1.png" SaveImageToJPG Bitmap, "F:\work_vb\1.jpg", 100 SaveImageToGIF Bitmap, "F:\work_vb\1.gif" ...
ReDim Files(0 To nFiles - 1) As String Filename = Space(MAX_PATH) ' Retrieve each filename in Dropped Filelist. For i = 0 To nFiles - 1 Call DragQueryFile(hDrop, i, Filename, Len(Filename)) Files(i) = TrimNull(Filename) ...