查看單個文章
舊 2017-06-28, 09:20 PM   #3 (permalink)
魔術王子
版區管理員
 
魔術王子 的頭像
榮譽勳章
UID - 115097
在線等級: 級別:42 | 在線時長:2005小時 | 升級還需:16小時級別:42 | 在線時長:2005小時 | 升級還需:16小時
註冊日期: 2004-01-13
住址: 魔術學園
文章: 3026
精華: 0
現金: 15117 金幣
資產: 2678747 金幣
預設

有這麼好用的語法喔
這是用vb 2008完全不用引用API
PHP 語法:
        Me.Hide()
        
Dim dt As Double My.Computer.Clock.TickCount
        
While My.Computer.Clock.TickCount dt 1000
            My
.Application.DoEvents()
        
End While
        
Dim g As Graphics
        Dim bmp 
As Bitmap
        bmp 
= New Bitmap(My.Computer.Screen.Bounds.WidthMy.Computer.Screen.Bounds.Height)
        
Graphics.FromImage(bmp)
        
g.CopyFromScreen(New Point(00), New Point(00), New Size(My.Computer.Screen.Bounds.WidthMy.Computer.Screen.Bounds.Height))
        
g.Dispose()
        
'Dim i As Integer = 1
        '
While (My.Computer.FileSystem.FileExists(My.Computer.FileSystem.SpecialDirectories.Desktop "\ToyAide" ".jpg"))
        
' i += 1
        ' 
End While
        
' bmp.Save(My.Computer.FileSystem.SpecialDirectories.Desktop & "\ToyAide" & i & ".jpg")
        '
PictureBox1.Image bmp
        Me
.Show()
        
PictureBox1.Image bmp 
當然這是從網路上找到的,另外.NET還有圖片翻轉功能
PHP 語法:
        If PictureBox1.Image IsNot Nothing Then
            Dim Img 
As Image PictureBox1.Image
            Img
.RotateFlip(RotateFlipType.Rotate270FlipNone)
            
PictureBox1.Image Img
            Img 
Nothing
            ImageSize
()
        
End If 
再附加尺寸縮小語法
PHP 語法:
        ' If My.Computer.Clipboard.ContainsImage Then
        ' 
Get the scale factor.
        
Dim scale_factor As Single 0.5 'Single.Parse(txtScale.Text)

        ' 
Get the source bitmap.
        
Dim bm_source As New Bitmap(PictureBox1.Image)

        
' Make a bitmap for the result.
        Dim bm_dest As New Bitmap(CInt(bm_source.Width * scale_factor), CInt(bm_source.Height * scale_factor))

        ' 
Make a Graphics object for the result Bitmap.
        
Dim gr_dest As Graphics Graphics.FromImage(bm_dest)

        
' Copy the source image into the destination bitmap.
        gr_dest.DrawImage(bm_source, 0, 0, bm_dest.Width + 1, bm_dest.Height + 1)

        ' 
Display the result.
        
' My.Computer.Clipboard.SetImage(bm_dest)
        ' 
PictureBox1.Image My.Computer.Clipboard.GetImage
        
'PictureBox1.Image = bm_dest
        '  
End If
        
PictureBox1.Image bm_dest
        ImageSize
() 
__________________
『唸金母心咒:嗡。金母。悉地。吽。』
持此咒者,可免一切瘟疫,一切瘟神抱頭四散。

魔術就是欣賞神奇的效果
如果魔術的秘密被破解了
那魔術就失去欣賞的價值
魔術王子 目前離線  
送花文章: 1537, 收花文章: 1560 篇, 收花: 3905 次
回覆時引用此帖
向 魔術王子 送花的會員:
mini (2017-06-28)
感謝您發表一篇好文章