ClassLibraryWeiBao/QR二维码/Windows/Render/EncapsulatedPostScriptRenderer.cs
(开头部分) 10KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Globalization;
#if NETFX_CORE
using Windows.UI;
#else
#endif
namespace Gma.QrCodeNet.Encoding.Windows.Render
{
public class EncapsulatedPostScriptRenderer
{
private ISizeCalculation m_iSize;
#if NETFX_CORE
private Color m_DarkColor;
private Color m_LightColor;
#else
private GColor m_DarkColor;
private GColor m_LightColor;
#endif
private EpsModuleDrawingTechnique m_DrawingTechnique;
/// <summary>
/// Initializes a Encapsulated PostScript renderer.
/// </summary>
/// <param name="darkColor">DarkColor used to draw Dark modules of the QrCode</param>
/// <param name="lightColor">LightColor used to draw Light modules and QuietZone of the QrCode.
/// Setting to a transparent color (A = 0) allows transparent light modules so the QR Code blends in the existing background.
/// In that case the existing background should remain light and rather uniform, and higher error correction levels are recommended.</param>
/// <param name="quietZoneModules"></param>
#if NETFX_CORE
public EncapsulatedPostScriptRenderer(ISizeCalculation iSize, Color darkColor, Color lightColor)
{
#else
public EncapsulatedPostScriptRenderer(ISizeCalculation iSize, GColor darkColor, GColor lightColor)
{
#endif
m_iSize = iSize;
m_DarkColor = darkColor;
m_LightColor = lightColor;
m_DrawingTechnique = EpsModuleDrawingTechnique.Squares;
}
/// <summary>
/// Renders the matrix in an Encapsuled PostScript format.
/// </summary>
/// <param name="matrix">The matrix to be rendered</param>
/// <param name="moduleSize">Size in points (1 inch contains 72 point in PostScript) of a module</param>
/// <param name="stream">Output stream that must be writable</param>
public void WriteToStream(BitMatrix matrix, Stream stream)
{
using (var writer = new StreamWriter(stream))
{
int width = matrix == null ? 21 : matrix.Width;
后面还有 276 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。