国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
用vb做圖片瀏覽器,旋轉(zhuǎn)代碼??
另附我已設(shè)計好的代碼:(無旋轉(zhuǎn)功能)

Private Sub Command3_Click() '結(jié)束按鈕
Dim exi As String
exi = MsgBox("您真的想退出嗎?", vbYesNo + vbQuestion + vbDefaultButton1, "退出")
If exi = vbYes Then
End
End If
End Sub

Private Sub Command2_Click() '圖片縮小程序
Image1.Height = Image1.Height - 50
Image1.Width = Image1.Width - 50 '按下的時候控件的高和寬各減小50
End Sub

Private Sub Command1_Click() '圖片放大程序
Image1.Height = Image1.Height + 50
Image1.Width = Image1.Width + 50 '按下的時候控件的高和寬各增加50
End Sub

Private Sub Command4_Click() '圖片清除程序
Image1.Picture = LoadPicture
Image1.Enabled = False
End Sub
Private Sub Command5_Click()
'上一張按鈕
If File1.ListCount > 0 Then
Dim nextID As Long
'當(dāng)前的id-1
nextID = File1.ListIndex - 1
'如果是第一張,就跳到最后一張
If nextID < 0 Then nextID = File1.ListCount - 1
'在列表中選中
File1.Selected(nextID) = True
'加載
Image1.Picture = LoadPicture(File1)
End If
End Sub
Private Sub Command6_Click()
'下一張按鈕
If File1.ListCount > 0 Then
Dim nextID As Long
nextID = File1.ListIndex + 1
If nextID >= File1.ListCount Then nextID = 0

File1.Selected(nextID) = True
Image1.Picture = LoadPicture(File1)
End If
End Sub

Private Sub Dir1_Change() '目錄改變,文件控件中顯示的文件改變.
ChDir Dir1.Path
File1.Pattern = "*.jpeg;*.jpg;*.bmp;*.ico" '只能裝入擴展名為.BMP、.JPG、.ICO的文件
File1.Path = Dir1.Path
End Sub

Private Sub Drive1_Change() '驅(qū)動器改變,目錄控件顯示改變后驅(qū)動器的文件夾
ChDrive Drive1.Drive
Dir1.Path = Drive1.Drive
End Sub

Private Sub File1_Click() '單擊控件中文件名稱的事件
Text1.Text = File1.Path + "\" + File1 '用來在文本框中顯示被選中的圖形名
Image1.Picture = LoadPicture(File1.Path + "\" + File1) '當(dāng)雙擊文件列表中的文件時,文件在圖像框中顯示出來
End Sub

Private Sub Form1_Load() '程序裝載,開始程序
File1.Pattern = "*.jpeg;*.jpg;*.bmp;*.ico" '在文件列表框中顯示擴展名為.BMP、.JPG、.ICO的文件
End Sub
采納率:55%12級2013.06.15
VB6.0實現(xiàn)圖片旋轉(zhuǎn)

使用過ACDSEE的朋友一定對它的JPG圖片旋轉(zhuǎn)功能記憶猶新,其實我們利用VB6的先進功能,可以對任意格式的圖片文件(包括JPG、GIF、BMP、ICO等)進行45度、180度旋轉(zhuǎn),確實可以和ACDSEE一較高下。
啟動vb6建立一個標(biāo)準(zhǔn)exe工程,首先添加兩個圖片框(picture1和picture2),添加三個命令按鈕command1(caption=“正常顯示”)、command2(caption=“180度倒立”)、command3(caption=“45度旋轉(zhuǎn)”),雙擊窗體,寫入以下代碼:
PrivateConstSRCCOPY=&HCC0020
PrivateConstPi=3.14
PrivateDeclareFunctionSetPixelLib"gdi32"(ByValhdcAsLong, ByValxAsLong,ByValyAsLong,ByValcrColorAsLong)AsLong
PrivateDeclareFunctionGetPixelLib"gdi32"(ByValhdcAsLong, ByValxAsLong,ByValyAsLong)AsLong

PrivateDeclareFunctionStretchBltLib"gdi32"(ByValhdcAsLong, ByValxAsLong,ByValyAsLong,ByValnWidthAsLong,ByValnHeightAsLong, ByValhSrcDCAsLong,ByValxSrcAsLong,ByValySrcAsLong,ByValnSrcWidth AsLong,ByValnSrcHeightAsLong,ByValdwRopAsLong)AsLong

privateSubbmp_rotate(pic1AsPictureBox,pic2AsPictureBox,ByValtheta)‘45度旋轉(zhuǎn)
Dimc1xAsInteger,c1yAsInteger
Dimc2xAsInteger,c2yAsInteger
DimaAsSingle
Dimp1xAsInteger,p1yAsInteger
Dimp2xAsInteger,p2yAsInteger
DimnAsInteger,rAsInteger

c1x=pic1.ScaleWidth\2
c1y=pic1.ScaleHeight\2
c2x=pic2.ScaleWidth\2
c2y=pic2.ScaleHeight\2
Ifc2x<c2yThenn=c2yElsen=c2x
n=n-1
pic1hDC=pic1.hdc
pic2hDC=pic2.hdc
Forp2x=0Ton
Forp2y=0Ton
Ifp2x=0Thena=Pi/2Elsea=Atn(p2y/p2x)
r=Sqr(1&*p2x*p2x+1&*p2y*p2y)
p1x=r*Cos(a+theta)
p1y=r*Sin(a+theta)
c0&=GetPixel(pic1hDC,c1x+p1x,c1y+p1y)
c1&=GetPixel(pic1hDC,c1x-p1x,c1y-p1y)
c2&=GetPixel(pic1hDC,c1x+p1y,c1y-p1x)
c3&=GetPixel(pic1hDC,c1x-p1y,c1y+p1x)
Ifc0&<>-1ThenSetPixelpic2hDC,c2x+p2x,c2y+p2y,c0
Ifc1&<>-1ThenSetPixelpic2hDC,c2x-p2x,c2y-p2y,c1
Ifc2&<>-1ThenSetPixelpic2hDC,c2x+p2y,c2y-p2x,c2
Ifc3&<>-1ThenSetPixelpic2hDC,c2x-p2y,c2y+p2x,c3
Next
Next
EndSub

PrivateSubCommand1_Click()‘正常復(fù)制
Picture2.Cls
px=Picture1.ScaleWidth
py=Picture1.ScaleHeight
StretchBltPicture2.hdc,px,0,-px,py,Picture1.hdc,0,0,px,py,SRCCOPY
EndSub

PrivateSubCommand2_Click()‘180度倒立
Picture2.Cls
px=Picture1.ScaleWidth
py=Picture1.ScaleHeight
StretchBltPicture2.hdc,0,py,px,-py,Picture1.hdc,0,0,px,py,SRCCOPY
EndSub

PrivateSubCommand3_Click()‘45旋轉(zhuǎn)
Picture2.Cls
Callbmp_rotate(Picture1,Picture2,3.14/4)
EndSub

PrivateSubForm_Load()
onErrorResumeNext
Me.Caption=App.Title"添加應(yīng)用程序標(biāo)題
Me.Left=(Screen.Width-Me.Width)/2
Me.Top=(Screen.Height-Me.Height)/2"窗體具中
Picture1.ScaleMode=3
Picture2.ScaleMode=3
EndSub
我只會做到下面的代碼了.其中:
Dir1-目錄列表控件
Drive1-驅(qū)動器列表控件
File1-文件列表控件
Image1-圖像控件
Text1-文本框控件
Option1-單選控件(Caption為"通過單擊瀏覽")
Option2-單選控件(Caption為"通過雙擊瀏覽")

Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
On Error GoTo DriErr
Dir1.Path = Drive1.Drive
Exit Sub
DriErr:
If Err.Number = 68 Then
If MsgBox("請問要重試還是取消?", vbRetryCancel + vbCritical, "硬盤不存在或光驅(qū)沒有插入磁盤!") = vbRetry Then
Resume 0
Else
Drive1.Drive = "C:"
Resume Next
End If
End If
End Sub
Private Sub File1_Click()
If Option2.Value = True Then Exit Sub
Dim picFile As String
If Right(Dir1.Path, 1) = "\" Then
picFile = Dir1.Path + File1.FileName
Else
picFile = Dir1.Path + "\" + File1.FileName
End If
Image1.Picture = LoadPicture(picFile)
Text1.Text = picFile
End Sub
Private Sub File1_DblClick()
If Option1.Value = True Then Exit Sub
Dim picFile As String
If Right(Dir1.Path, 1) = "\" Then
picFile = Dir1.Path + File1.FileName
Else
picFile = Dir1.Path + "\" + File1.FileName
End If
Image1.Picture = LoadPicture(picFile)
Text1.Text = picFile
End Sub
本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
VB截屏(拷貝屏幕圖像)代碼
python如何提取word內(nèi)的圖片
VB入門技巧N例(8)
vb 遍歷文件夾 與遍歷文件
人員表中輸入人名自動提取人員表相同文件夾中的相片
用VB實現(xiàn)圖形文件的批量轉(zhuǎn)換
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服