English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
所有分類

可否請大大教我寫如何把一張圖片檔切割為四份ㄚ!
可否有範例!我想學一下!謝謝各為大大!

2006-05-02 06:29:43 · 1 個解答 · 發問者 5 in 電腦與網際網路 程式設計

那可否再教我如何把這四張圖片作一下結合為一張ㄚ?
ps:不好意思可否再幫我一下!謝謝個位大大!

2006-05-02 11:31:36 · update #1

1 個解答

'表單置1個CommandButton及1個PictureBox(本方式只能存檔成.bmp,若欲存成.jpg還需引用到別的dll)Private Sub Command1_Click()Dim P As Picture, W&, H&, X&, Y&, I%ScaleMode = 3Set P = LoadPicture("C:\Test.bmp") '載入圖片W = P.Width * 567 \ 1000 \ Screen.TwipsPerPixelXH = P.Height * 567 \ 1000 \ Screen.TwipsPerPixelXI = 1With Picture1    .Appearance = 0    .BorderStyle = 0    .ScaleMode = 3    .AutoRedraw = True    For X = 0 To W \ 2 Step W \ 2        If X = 0 Then           .Width = W \ 2        Else           .Width = W - W \ 2        End If        For Y = 0 To H \ 2 Step H \ 2            If Y = 0 Then               .Height = H \ 2            Else               .Height = H - H \ 2            End If            .PaintPicture P, 0, 0, .Width, .Height, X, Y, .Width, .Height            SavePicture .Image, "C:\Test(" & I & ").bmp"            I = I + 1        Next    Next    .Cls    .AutoRedraw = FalseEnd WithSet P = NothingMsgBox "已將分割後的圖片存在C:\,檔名為Test(1).bmp~Test(4).bmp"End Sub

2006-05-02 09:16:48 · answer #1 · answered by W.J.S. 7 · 0 0

fedest.com, questions and answers