当前位置:网站首页>Blooming old trees -- quickly build a map bed application with imageprocessor
Blooming old trees -- quickly build a map bed application with imageprocessor
2022-07-28 04:27:00 【InfoQ】
ImageProcessor brief introduction
Create project

Introducing extended
install-package imageprocessor.web<!--configSections New in node -->
<sectionGroup name="imageProcessor">
<section name="security" requirePermission="false" type="ImageProcessor.Web.Configuration.ImageSecuritySection, ImageProcessor.Web"/>
<section name="processing" requirePermission="false" type="ImageProcessor.Web.Configuration.ImageProcessingSection, ImageProcessor.Web"/>
<section name="caching" requirePermission="false" type="ImageProcessor.Web.Configuration.ImageCacheSection, ImageProcessor.Web"/>
</sectionGroup>
<!--system.web New in node -->
<httpModules>
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web"/>
</httpModules>
<!--system.webServer New in node -->
<modules>
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web"/>
</modules>
<!-- The root node configuration New -->
<imageProcessor>
<security configSource="config\imageprocessor\security.config"/>
<caching configSource="config\imageprocessor\cache.config"/>
<processing configSource="config\imageprocessor\processing.config"/>
</imageProcessor>
See the effect


- tailoring

Other functions
using (ImageFactory imageFactory = new ImageFactory(preserveExifData: true))
{
imageFactory.Load(inStream);
ISupportedImageFormat format = new JpegFormat { Quality = 70 };
Size size = new Size(150, 0);
foreach (var item in model.content_list)
{
FontFamily ff = new FontFamily(item.font_family);
TextLayer textLayer = new TextLayer()
{
Text = item.content,
FontColor = Color.FromArgb(item.color_r, item.color_g, item.color_b),
Position = new Point(item.location_x, item.location_y),
FontSize = item.font_size,
FontFamily = ff
};
imageFactory.Watermark(textLayer);
// Whether to generate QR code
if (item.is_qrcode == 1)
{
// Generate qr code
string qrcode_path = QrCodeHelper.MakeQrcodeSaveLocal(item.qrcode_content);
#region Turn the image into a stream and add it to the certificate template
FileStream fileStream = new FileStream(qrcode_path, FileMode.Open, FileAccess.Read);
int byteLength = (int)fileStream.Length;
byte[] fileBytes = new byte[byteLength];
fileStream.Read(fileBytes, 0, byteLength);
// File stream closed , File unlocked
fileStream.Close();
#endregion
// Add QR code watermark to certificate template
ImageLayer imageLayer = new ImageLayer()
{
Image = Image.FromStream(new MemoryStream(fileBytes)),// First turn the picture into a stream , Then add it to the certificate template, and it won't occupy the image
Position = new Point(item.qrcode.location_x, item.qrcode.location_y),
Size = new Size(item.qrcode.width, item.qrcode.height),
Opacity = item.qrcode.opacity
};
imageFactory.Overlay(imageLayer);
// Delete local QR code
if (item.isdel_qrcode == 1)
{
FileHelper.DeleteLocalFile(qrcode_path);
}
}
}
imageFactory.Save(outStream);
imageFactory.Dispose();
}
边栏推荐
- 仿真测试断开服务器公网连接
- Kotlin -- function
- Kingbasees Security Guide for Jincang database -- 6.1 introduction to strong authentication
- After login, the upper right corner changes to enter the login status
- 金仓数据库KingbaseES安全指南--5.2. 数据完整性保护
- Reading of the paper "attentional encoder network for targeted sentimental classification"
- [untitled]
- 【day03】流程控制语句
- openpose的一些个人理解
- Use Baidu developer tool 4.0 to build a dedicated applet IDE
猜你喜欢

校园流浪猫信息记录和分享的小程序源码

High number_ Chapter 4__ Curvilinear integral_ Exercise solution

虚拟机类加载机制

MySQL:数据类型和运算符

Kotlin——函数

Bio annotation of emotion analysis aste triples extraction

网页源代码查看竟然有这么多方法!你都知道吗?

Practice and thinking of AI standardization engine in pink client

Shanghai Telecom released public computing services and signed the action plan of "Joint Innovation Center for intelligent computing applications" with Huawei and other partners

RT thread changes the print serial port (add other functions on the basis of BSP)
随机推荐
20-Openwrt crond crontab
Seamless support for hugging face community, colossal AI low-cost and easy acceleration of large model
Detailed explanation of pl/sql parameters ("box model")
"Three no's and five requirements" principle of enterprise Digitalization Construction
Simple summary of Modbus Protocol
Information system project manager (2022) - key content: Strategic Management (17)
校园流浪猫信息记录和分享的小程序源码
C # cross thread refresh foreground UI
空间复杂度计算超全整理!!(一起手撕复杂度计算
Reading of papers on "towards generative aspect based sentimental analysis"
《KG-BERT: BERT for Knowledge Graph Completion》
DNS series (III): how to avoid DNS spoofing
There are so many ways to view the web source code! Do you know?
Fedformer MOE module
Password key hard coding check
方舟生存进化自建服务器要多少成本?
RT thread changes the print serial port (add other functions on the basis of BSP)
Cyber Nuwa, how to make digital people?
ESP8266 WIFI 模块和手机通信
26 openwrt port forwarding DMZ UPnP