feature: document template QR Code image extensions

This commit is contained in:
Gary Sharp
2023-10-12 15:51:33 +11:00
parent 7353405b16
commit a3fb09440d
17 changed files with 299 additions and 65 deletions
@@ -118,15 +118,28 @@ namespace Disco.Services.Expressions.Extensions
}
public static BitmapImageExpressionResult OrganisationLogo()
{
var configCache = new Disco.Data.Configuration.SystemConfiguration(null);
var configCache = new Data.Configuration.SystemConfiguration(null);
BitmapImageExpressionResult result;
using (var orgLogo = configCache.OrganisationLogo)
{
result = ImageFromStream(orgLogo);
}
result.LosslessFormat = true;
result.Format = Models.Services.Expressions.Extensions.ImageExpressionFormat.Png;
return result;
}
public static QrCodeImageExpressionResult QrCode(string content)
{
return new QrCodeImageExpressionResult(content, 'M');
}
public static QrCodeImageExpressionResult QrCode(string content, string errorCorrectionLevel)
{
if (string.IsNullOrWhiteSpace(errorCorrectionLevel))
errorCorrectionLevel = "M";
return new QrCodeImageExpressionResult(content, errorCorrectionLevel[0]);
}
}
}