You can do something like this (I used two pictureboxes):
Code:Private Sub Command1_Click() Dim centerX%, centerY% Dim iWidth%, iHeight% centerX = Picture1.ScaleWidth / 2 centerY = Picture1.ScaleHeight / 2 iWidth = 1000 iHeight = 500 With Picture2 .AutoRedraw = True .AutoSize = True .Width = iWidth .Height = iHeight .PaintPicture Picture1.Picture, 0, 0, _ iWidth, iHeight, _ centerX - iWidth / 2, centerY - iHeight / 2, _ iWidth, iHeight Set .Picture = .Image .Cls End With End Sub




Reply With Quote