Patches the image using a given bitmap and writes the result to the specified file.
Namespace:
Aurigma.GraphicsMill.Codecs
Assembly:
Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)
public void WritePatched(
string fileName,
Point offset,
Bitmap bitmap
)
Type: System.String
The name of the file to save the result.Type: System.Drawing.Point
A Point at which the bitmap should be placed. Note, it should be aligned to MCU using the AlignToMCUSize(Rectangle, JpegAlignToSampleSizeMode) method.Type: Aurigma.GraphicsMill.Bitmap
A Bitmap to place at the given position.var rect = new System.Drawing.Rectangle(152, 136, 72, 32);
using (var patchBitmap = new Bitmap())
{
//Apply crop and mosaic transfroms
using (var input = new Bitmap(@"Images\in.jpg"))
using (var crop = new Crop(rect))
using (var mosaic = new Mosaic(4, 4))
{
Pipeline.Run(input + crop + mosaic + patchBitmap);
}
//Patch JPEG
using (var losslessJpeg = new LosslessJpeg(@"Images\in.jpg"))
{
rect = losslessJpeg.AlignToMCUSize(rect, JpegAlignToSampleSizeMode.Patch);
losslessJpeg.WritePatched(@"Images\Output\out.jpg", rect.Location, patchBitmap);
}
}