1 Replies - 283 Views - Last Post: 07 December 2016 - 08:17 AM Rate Topic: -----

#1 Sydbee  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-December 16

How do I resize an image that I'm calling to in my code?

Posted 07 December 2016 - 07:39 AM

Here is the code I've already started.
 Private Sub Asteroids_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
        Dim horizontalMovement As Integer = 0
        Dim verticalMovement As Integer = 0

        If (e.KeyCode = Keys.Right) Then
            PictureBoxPlayer.Image = Image.FromFile("file")
            horizontalMovement = 5
        ElseIf (e.KeyCode = Keys.Left) Then
            horizontalMovement = -5
        ElseIf (e.KeyCode = Keys.Up) Then
            verticalMovement = -5
        ElseIf (e.KeyCode = Keys.Down) Then
            verticalMovement = +5
        End If

        PictureBoxPlayer.Left += horizontalMovement
        PictureBoxPlayer.Top += verticalMovement


    End Sub 
:code:

I'm looking to be able to resize my picture box or the image.

This post has been edited by modi123_1: 07 December 2016 - 07:42 AM
Reason for edit:: fixed botched code tags


Is This A Good Question/Topic? 0
  • +

Replies To: How do I resize an image that I'm calling to in my code?

#2 andrewsw  Icon User is offline

  • say what now
  • member icon

Reputation: 6403
  • View blog
  • Posts: 25,878
  • Joined: 12-December 12

Re: How do I resize an image that I'm calling to in my code?

Posted 07 December 2016 - 08:17 AM

Your using Left and Top, what about Width and Height? [They might put some wheels on this.]
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1