JezB
Tue Jan 17 10:55:17 CST 2006
This does not quite work, in that the image does not always start at the top
left pixel within the target rectangle. While this is not always important,
it is in my case.
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:em13phVEGHA.344@TK2MSFTNGP11.phx.gbl...
> "JezB" <jezbroadsword@blueyonder.co.uk> schrieb:
>> I'm trying to write a routine to tile a given image in a given rectangle:
>
> The snippet below should point you into the right direction:
>
> \\\
> Private m_Brush As TextureBrush
>
> Private Sub Form1_Load(...) Handles MyBase.Load
> m_Brush = New TextureBrush(New Bitmap("C:\WINDOWS\Angler.bmp"))
> End Sub
>
> Protected Overrides Sub OnPaintBackground(ByVal e As PaintEventArgs)
> MyBase.OnPaintBackground(e)
> e.Graphics.FillRectangle(m_Brush, Me.ClientRectangle)
> End Sub
> ///
>
> --
> M S Herfried K. Wagner
> M V P <URL:
http://dotnet.mvps.org/>
> V B <URL:
http://classicvb.org/petition/>