An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
I think that you can use a TextureBrush. For example, you can build it dynamically:
Bitmap bitmap = new Bitmap( 100, 100, System.Drawing.Imaging.PixelFormat.Format32bppPArgb );
Graphics graph = Graphics.FromImage( bitmap );
Rectangle rect = new Rectangle( 0, 0, 100, 100 );
using( var img = new Bitmap( 8, 8, graph ) )
{
using( var g = Graphics.FromImage( img ) )
{
g.Clear( Color.Orange );
g.FillRectangle( Brushes.White, 0, 6, 2, 2 );
g.FillRectangle( Brushes.White, 4, 3, 2, 2 );
}
var tb = new TextureBrush( img );
graph.FillRectangle( tb, rect );
}
bitmap.Save( "myImage.png", System.Drawing.Imaging.ImageFormat.Png );
You can load the texture brush from an existing image too, made by a Graphical Editor or Visual Studio, saved as a file or embedded resource.
It is also possible to scale it using tb.ScaleTransform.
![using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
static void Main(string[] args)
{
//Image image = new Bitmap(1000, 1000, PixelFormat.Format32bppArgb);
Bitmap bitmap = new Bitmap(100, 100, System.Drawing.Imaging.PixelFormat.Format32bppPArgb);
Graphics graph = Graphics.FromImage(bitmap);
Pen pen = new Pen(Brushes.Green);
Rectangle rect = new Rectangle(0, 0, 100, 100);
graph.DrawRectangle(pen, rect);
Brush b = new HatchBrush(HatchStyle.Percent90, Color.Orange, Color.White);
// Fill rectangle to screen.
graph.FillRectangle(b, rect);
bitmap.Save("myImage.png", System.Drawing.Imaging.ImageFormat.Png);
}](https://learn-attachment.microsoft.com/api/attachments/256917-myimage.png?platform=QnA)