如何使用图像和纹理蒙版平铺形状?

How to Tile a Shape with Image and Texture Mask?

我如何通过使用纹理蒙版将带有纹理画笔的 FillRectangle 应用于源图像?

类似的东西...但是如何使用纹理遮罩?

    Bitmap textile = new Bitmap("textile.png");
    TextureBrush textileBrush = new TextureBrush(textile);
    Bitmap outfit = new Bitmap("outfit.png");
    Bitmap masksource = new Bitmap("mask.png");

    Color bodyColorKey = Color.FromArgb(0, 255, 0);

    //what i should to do next and how to apply FillRectangle?
    using (Graphics g = Graphics.FromImage(outfit))
    {
        g.FillRectangle(textileBrush, new Rectangle(0, 0, ???, ???));
    }

装备: 还有他的面具: 纺织质地: 以及它应该如何处理,输出:

有什么想法应该如何寻找 System.Drawing?

使用蒙版图像,使给定颜色透明并按如下方式组合图像。

Bitmap textile = new Bitmap("textile.png");
        TextureBrush textileBrush = new TextureBrush(textile);
        Bitmap outfit = new Bitmap("outfit.png");
        Bitmap masksource = new Bitmap("mask.png");

        Bitmap transparentImage = new Bitmap(outfit.Width, outfit.Height);

        masksource.MakeTransparent(Color.FromArgb(255, 0, 255, 0));
        using (Graphics g = Graphics.FromImage(transparentImage))
        {
            g.DrawImage(outfit, new Point(0, 0));
            //g.DrawImage(textile, new Point(0, 0)); // use texture image
            g.FillRectangle(textileBrush, g.ClipBounds); // use texture image as Tile mode
            g.DrawImage(masksource, new Point(0, 0));
            transparentImage.MakeTransparent(Color.FromArgb(255, 255, 0, 0));
            transparentImage.MakeTransparent(Color.FromArgb(255, 0, 0, 255));
        }
        Bitmap outputImage = new Bitmap(outfit.Width, outfit.Height);
        using (Graphics g = Graphics.FromImage(outputImage))
        {
            g.DrawImage(outfit, new Point(0, 0));
            g.DrawImage(transparentImage, new Point(0, 0));
        }

只需要用纹理图像填充矩形

//what i should to do next and how to apply FillRectangle?
using (Graphics g = Graphics.FromImage(outfit))
{
    g.FillRectangle(textileBrush,g.ClipBounds);
}