H
Herfried K. Wagner
Hello,
In VB .NET:
\\\
Private m_bi As Bitmap
Private Sub Form1_Load( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
) Handles MyBase.Load
m_bi = Image.FromFile("C:\WINDOWS\Angler.bmp")
End Sub
Private Sub Form1_Resize( _
ByVal sender As Object, _
ByVal e As System.EventArgs _
) Handles MyBase.Resize
Me.CreateGraphics().DrawImage( _
m_bi, 0, 0, m_bi.Width, m_bi.Height _
)
End Sub
Private Sub Form1_Paint( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.PaintEventArgs _
) Handles MyBase.Paint
e.Graphics.DrawImage(m_bi, 0, 0, m_bi.Width,
m_bi.Height)
End Sub
///
Regards,
Herfried K. Wagner
Arthur Hsu said:I write a windows form using C# with a background image on it. When it's
running on US English Windows, everything is fine. When it's running on
Chinese Windows, the background image tiled up. How can I stretch the
background image to fit this form?
In VB .NET:
\\\
Private m_bi As Bitmap
Private Sub Form1_Load( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
) Handles MyBase.Load
m_bi = Image.FromFile("C:\WINDOWS\Angler.bmp")
End Sub
Private Sub Form1_Resize( _
ByVal sender As Object, _
ByVal e As System.EventArgs _
) Handles MyBase.Resize
Me.CreateGraphics().DrawImage( _
m_bi, 0, 0, m_bi.Width, m_bi.Height _
)
End Sub
Private Sub Form1_Paint( _
ByVal sender As Object, _
ByVal e As System.Windows.Forms.PaintEventArgs _
) Handles MyBase.Paint
e.Graphics.DrawImage(m_bi, 0, 0, m_bi.Width,
m_bi.Height)
End Sub
///
Regards,
Herfried K. Wagner