Update: A better solution!
I continued to work on this problem, and now I have found a way to use the original bitmaps. In fact, since I am only dealing with a hatch pattern (2 colors), I can change the bitmaps to 2 color mode (PixelFormat.Format1bppIndexed)!
All it requires is to change the palette information to use the new color(s), then lock the bitmap into memory, then unlock it again. Here is a modified example:
public static Image LoadHatchPattern(int index, Color foreground)
{
Stream s = Assembly.GetExecutingAssembly().GetManifestResourceStream("Designer.Textures.Hatch1.bmp");
Bitmap b = new Bitmap(s);
ColorPalette pal = b.Palette;
pal.Entries[0] = foreground;
b.Palette = pal;
BitmapData data = b.LockBits(new Rectangle(0, 0, b.Width, b.Height), ImageLockMode.ReadWrite, b.PixelFormat);
b.UnlockBits(data);
b.MakeTransparent();
return b;
}
This works exactly the way I want it to, and now I can use B&W 2 color bitmaps, which are much smaller!
NOTE: I could pass the background color to this function, then add the line below to change out the background color as well. If I do this, I would then remove the call to "b.MakeTransparent()", since I am specifying the background color.
pal.Entries[1] = background;