mookie0001
Technical User
Hi everyone,
I am having a strange problem when drawing a bitmap to a picturebox. For some reason, when the bitmap is drawn - it is scaled larger than it's actual size. For example, if the screen resolution is set to 1024x768 and the image size is the same - the image will be rendered larger than 1024x768 in the picturebox. Thanks for your help in advance!
-Chris
Here is the relevant source code regarding my problem:
Dim gameboard_image As New Bitmap("e:\background.jpg"
Dim bufferBitmap = New Bitmap(gameboard_image.Width, gameboard_image.Height)
Private Sub gameboard_lg_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles gameBoard_lg.Paint
Dim bufferGraphics = Graphics.FromImage(bufferBitmap)
bufferGraphics.Clear(Color.Black)
bufferGraphics.DrawImageUnscaled(gameboard_image, m_dragOffset)
e.Graphics.DrawImageUnscaled(bufferBitmap, 0, 0)
End Sub
I am having a strange problem when drawing a bitmap to a picturebox. For some reason, when the bitmap is drawn - it is scaled larger than it's actual size. For example, if the screen resolution is set to 1024x768 and the image size is the same - the image will be rendered larger than 1024x768 in the picturebox. Thanks for your help in advance!
-Chris
Here is the relevant source code regarding my problem:
Dim gameboard_image As New Bitmap("e:\background.jpg"
Dim bufferBitmap = New Bitmap(gameboard_image.Width, gameboard_image.Height)
Private Sub gameboard_lg_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles gameBoard_lg.Paint
Dim bufferGraphics = Graphics.FromImage(bufferBitmap)
bufferGraphics.Clear(Color.Black)
bufferGraphics.DrawImageUnscaled(gameboard_image, m_dragOffset)
e.Graphics.DrawImageUnscaled(bufferBitmap, 0, 0)
End Sub