Sub Form_Load()
Me.ScaleMode = vbPixels
Picture1.ScaleMode = vbPixels
Picture2.ScaleMode = vbPixels
Picture1.AutoSize = True
Picture1.AutoRedraw = True
Picture2.AutoRedraw = True
Picture2.Width = 30
Picture2.Height = 60
Picture2.PaintPicture Picture1.Picture, 0, 0, 30, 60, 0, 0, 30, 60, vbSrcCopy
SavePicture Picture2.Image, "C:\File.bmp"
End Sub
Option Explicit
Private Sub Form_Load()
Dim KX As Long, KY As Long, W As Boolean, H As Boolean, X As Long, Y As Long
If Picture1.Width / 30 = Picture1.Width \ 30 Then W = True
If Picture1.Height / 60 = Picture1.Height \ 60 Then H = True
KX = Picture1.Width \ 30 + CLng(W) + 1
KY = Picture1.Height \ 60 + CLng(H) + 1
For X = 0 To KX
For Y = 0 To KY
GetAndSaveRect X * 30, Y * 60
Next
Next
End Sub
Sub GetAndSaveRect(ByVal lLeft As Long, ByVal lTop As Long)
Picture2.Cls
Picture2.PaintPicture Picture1.Picture, 0, 0, 30, 60, lLeft, lTop, 30, 60, vbSrcCopy
SavePicture Picture2.Image, "C:\MMM\" & lLeft / 30 & "-" & lTop / 60 & ".bmp"
End Sub
Me.ScaleMode = vbPixels
Picture1.ScaleMode = vbPixels
Picture2.ScaleMode = vbPixels
Picture1.AutoSize = True
Picture1.AutoRedraw = True
Picture2.AutoRedraw = True
Picture2.Width = 30
Picture2.Height = 60
Сейчас этот форум просматривают: Google-бот и гости: 7