求问这个dll是咋用的啊???

vb我截屏的图大了,每一个都3m多,有没有啥函数可以转化一下截屏文件的格式,将图片变的小一点啊。几十k这样的。
还有就是咋办把图片制作成gif的动态文件,vb是不是用一个wsAniGIF的dll

米琪卡哇伊
浏览 171回答 2
2回答

吃鸡游戏

SavePicture 语句从对象或控件(如果有一个与其相关)的 Picture 或 Image 属性中将图形保存到文件中。SavePicture 语句示例本例使用 SavePicture 语句保存画在 Form 对象的 Picture 属性中的图形。要试用此例,可将以下代码粘贴到 Form 对象的声明部分,然后运行此例,单击 Form 对象。Private Sub Form_Click ()   ' 声明变量。   Dim CX, CY, Limit, Radius   as Integer, Msg as String   ScaleMode = vbPixels   ' 设置比例模型为像素。   AutoRedraw = True ' 打开 AutoRedraw。   Width = Height   ' 改变宽度以便和高度匹配。   CX = ScaleWidth / 2   ' 设置 X 位置。   CY = ScaleHeight / 2   ' 设置 Y 位置。   Limit = CX   ' 圆的尺寸限制。   For Radius = 0 To Limit   ' 设置半径。      Circle (CX, CY), Radius, RGB(Rnd * 255, Rnd * 255, Rnd * 255)      DoEvents   ' 转移到其它操作。   Next Radius   Msg = "Choose OK to save the graphics from this form "   Msg = Msg & "to a bitmap file."   MsgBox Msg   SavePicture Image, "TEST.BMP"   ' 将图片保存到文件。End Sub 

猛跑小猪

Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As LongPrivate Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As LongPrivate Declare Function GdiplusStartup Lib "GDIPlus" (token As Long, inputbuf As GdiplusStartupInput, ByVal outputbuf As Long) As LongPrivate Declare Function GdiplusShutdown Lib "GDIPlus" (ByVal token As Long) As LongPrivate Declare Function GdipCreateBitmapFromHBITMAP Lib "GDIPlus" (ByVal hbm As Long, ByVal hpal As Long, Bitmap As Long) As LongPrivate Declare Function GdipDisposeImage Lib "GDIPlus" (ByVal Image As Long) As LongPrivate Declare Function GdipSaveImageToFile Lib "GDIPlus" (ByVal Image As Long, ByVal filename As Long, clsidEncoder As GUID, encoderParams As Any) As LongPrivate Declare Function CLSIDFromString Lib "ole32" (ByVal str As Long, id As GUID) As LongPrivate Declare Function GdipCreateBitmapFromFile Lib "GDIPlus" (ByVal filename As Long, Bitmap As Long) As LongPrivate Type GUIDData1 As LongData2 As IntegerData3 As IntegerData4(0 To 7) As ByteEnd TypePrivate Type GdiplusStartupInputGdiplusVersion As LongDebugEventCallback As LongSuppressBackgroundThread As LongSuppressExternalCodecs As LongEnd TypePrivate Type EncoderParameterGUID As GUIDNumberOfValues As Longtype As LongValue As LongEnd TypePrivate Type EncoderParametersCount As LongParameter As EncoderParameterEnd TypePrivate Sub Form_click()Me.HideMe.AutoRedraw = TruePicture1.Width = Screen.Width + 30Picture1.Height = Screen.Height + 30BitBlt Picture1.hDC, 0, 0, Screen.Width + 30, Screen.Height + 30, GetDC(0), 0, 0, vbSrcCopySet Picture1.Picture = Picture1.ImageCall PictureBoxSaveJPG(Picture1.Picture, Replace(App.Path & "\" & "test.JPG", "\\", "\")) '保存压缩后的图片EndEnd SubPrivate Function PictureBoxSaveJPG(ByVal pict As StdPicture, ByVal filename As String, Optional ByVal quality As Byte = 70) As Boolean'直接修改quality参数 即可缩小图片保存大小Dim tSI As GdiplusStartupInputDim lRes As LongDim lGDIP As LongDim lBitmap As Long'初始化 GDI+tSI.GdiplusVersion = 1lRes = GdiplusStartup(lGDIP, tSI, 0)If lRes = 0 Then'从句柄创建 GDI+ 图像lRes = GdipCreateBitmapFromHBITMAP(pict.Handle, 0, lBitmap)If lRes = 0 ThenDim tJpgEncoder As GUIDDim tParams As EncoderParameters'初始化解码器的GUID标识CLSIDFromString StrPtr("{557CF401-1A04-11D3-9A73-0000F81EF32E}"), tJpgEncoder'设置解码器参数tParams.Count = 1With tParams.Parameter ' Quality'得到Quality参数的GUID标识CLSIDFromString StrPtr("{1D5BE4B5-FA4A-452D-9CDD-5DB35105E7EB}"), .GUID.NumberOfValues = 1.type = 4.Value = VarPtr(quality)End With'保存图像lRes = GdipSaveImageToFile(lBitmap, StrPtr(filename), tJpgEncoder, tParams)'销毁GDI+图像GdipDisposeImage lBitmapEnd If'销毁 GDI+GdiplusShutdown lGDIPEnd IfIf lRes ThenPictureBoxSaveJPG = FalseElsePictureBoxSaveJPG = TrueEnd IfEnd Function
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

SQL Server