I want to tile one Form with a small portion of another Form. What am I doing wrong?
Code:Public Class Form71 Dim backImg As New Bitmap(Form70.Picture1.Image) ' 214 by 169 Dim tBr As New TextureBrush(backImg, wrapMode:=Drawing2D.WrapMode.TileFlipXY) ' Then we will replace the image with another one in Form_Load Private Sub Form71_Load(sender As Object, e As EventArgs) Handles MyBase.Load Dim NewImage As New Bitmap(80, 60) Using g As Graphics = Graphics.FromImage(NewImage) g.CopyFromScreen(Form70.Location.X, Form70.Location.Y, 400, 100, NewImage.Size) ' One of these two things should work but neither is working g.DrawImage(Form70.frmImage, New Rectangle(400, 100, 80, 60)) End Using tBr = New TextureBrush(NewImage, wrapMode:=Drawing2D.WrapMode.TileFlipXY) Me.Refresh() Private Sub Form71_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint e.Graphics.FillRectangle(tBr, ClientRectangle) End Sub




Reply With Quote
