if(ip.X + sWidth > pixelSize.Width&& i < images.Count()-1)
{
ip.X = margin;
ip.Y += sHeight;
if(ip.Y + sHeight > pixelSize.Height)
{
if(targetMime !=Util.MimeTypes.TIFF)
thrownewException("Unexpected: should get here only if target is TIFF.");
tw.AppendFrame(bmp);
bmp.Clear(Color.White);
ip.Y = margin;
}
}
}
switch(targetMime)
{
caseCommon.Util.MimeTypes.TIFF:
tw.Dispose();
break;
caseCommon.Util.MimeTypes.JPEG:
bmp.SaveAsJpeg(ms);
break;
caseCommon.Util.MimeTypes.PNG:
bmp.SaveAsPng(ms);
break;
caseCommon.Util.MimeTypes.BMP:
bmp.SaveAsBmp(ms);
break;
caseCommon.Util.MimeTypes.GIF:
bmp.SaveAsGif(ms);
break;
caseCommon.Util.MimeTypes.WEBP:
bmp.SaveAsWebp(ms);
break;
default:
thrownewException($"Encoding {targetMime} is not supported.");
}
bmp.Dispose();
g.Dispose();
// Dispose images when done:
images.ForEach(t_ => t_.Item2.Dispose());
return ms;
}
publicstaticList<string[]>GetSampleParamsList()
{
// Strings are name, description, info, rest are arbitrary strings:
returnnewList<string[]>()
{
newstring[]{"@b-svg/Font Awesome - brands","Render Font Awesome SVG glyphs from the \"svgs/brands\" directory",
"This sample renders the SVG icons included in the \"svgs/brands/\" directory of the Font Awesome \"Free for Web\" download, sorted by file name.",
"brands"},
newstring[]{"@b-svg/Font Awesome - regular","Render Font Awesome SVG glyphs from the \"svgs/brands\" directory",
"This sample renders the SVG icons included in the \"svgs/regular/\" directory of the Font Awesome \"Free for Web\" download, sorted by file name.",
"regular"},
newstring[]{"@b-svg/Font Awesome - solid","Render Font Awesome SVG glyphs from the \"svgs/solid\" directory",
"This sample renders the SVG icons included in the \"svgs/solid/\" directory of the Font Awesome \"Free for Web\" download, sorted by file name.",
"solid"},
newstring[]{"@b-svg/Font Awesome - colorize","Render Font Awesome SVG glyphs using random order and colors",
"This sample renders the SVG icons included in the \"svgs/\" directory of the Font Awesome \"Free for Web\" download, randomizing the order of the icons and their colors.",