Results 1 to 1 of 1

Thread: [2005] TextureBrush X Y Problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2006

    [2005] TextureBrush X Y Problem

    Have got this code

    Imports System.Drawing.Drawing2D

    Public Class MainForm
    Public MyTextureBrush As TextureBrush
    Public x, y, w, h As Integer

    Private Sub MainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim MyBitmap As Bitmap
    MyBitmap = New Bitmap(PacmanPic.Image)
    MyTextureBrush = New TextureBrush(MyBitmap, WrapMode.Clamp)
    End Sub

    Private Sub MainForm_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
    e.Graphics.FillRectangle(MyTextureBrush, x, y, w, h)
    End Sub

    Private Sub GoBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GoBtn.Click
    Dim a As Integer
    For a = 1 To 384 Step 1
    MyTextureBrush.TranslateTransform(1, 0)
    x = a
    y = 0

    w = 44
    h = 34
    Next a
    End Sub
    End Class

    My problem is I cannot change x and y values. If I do change them either the image gets cut off or disapears. (E.g. Change y to 5 does not move the image down the screen.)

    Can somebody help please? Have uploaded project
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


Click Here to Expand Forum to Full Width