vb picturebox image graphics offset

replenish the remaining place with image

Page 1 of 1

0 Replies - 1730 Views - Last Post: 24 March 2010 - 07:08 AM Rate Topic: -----

#1 hyylucy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 24-March 10

vb picturebox image graphics offset

Posted 24 March 2010 - 07:08 AM

I want to keep the image filling in the picturebox! And when i let the image turn rightward some OFFset, it can automatically replenish the remaining place with the same image in the picturebox.
I can implement the OFFset, but can't automatically replenish the picturebox.
I think it lose a bit code.
Public Class Form1
    Dim image As Image
    Dim number As Integer

    Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
        image = image.FromFile("E:\aa.jpg")
        'e.Graphics.DrawImage(image, 0, 0, 450, 260)
        e.Graphics.DrawImage(image, number, 0, 450, 260)
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        Select Case ComboBox1.SelectedIndex
            Case 0
                number = 100
            Case 1
                number = 0
            Case 2
                number = 50
            Case 3
                number = 70
        End Select
        PictureBox1.Refresh()
    End Sub
End Class

This post has been edited by hyylucy: 24 March 2010 - 07:14 AM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1