Public Class Form1 Dim img As Image = Image.FromFile("C:\俺の嫁.bmp") Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint Dim imgアスペクト比 As Double = img.Width / img.Height Dim pbアスペクト比 As Double = sender.Width / sender.Height Dim 描画サイズ As Size If imgアスペクト比 > pbアスペクト比 Then 描画サイズ = New Size(sender.Width, sender.Width / imgアスペクト比) ElseIf imgアスペクト比 < pbアスペクト比 Then 描画サイズ = New Size(sender.Height * imgアスペクト比, sender.Height) Else 描画サイズ = New Size(sender.Width, sender.Height) End If e.Graphics.DrawImage(img, sender.Width - 描画サイズ.Width - 1, 0, 描画サイズ.Width, 描画サイズ.Height) End Sub Private Sub PictureBox1_SizeChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.SizeChanged sender.Refresh() End Sub End Class