123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899 |
- using Resources;
- using SmartCoalApplication.Base;
- using SmartCoalApplication.Base.Enum;
- using System;
- using System.Collections.Specialized;
- using System.ComponentModel;
- using System.Drawing;
- using System.Drawing.Drawing2D;
- using System.Drawing.Imaging;
- using System.Windows.Forms;
- namespace SmartCoalApplication.Core
- {
- [Serializable]
- public sealed class Document : IDisposable
- {
- public Surface surface;
- private NameValueCollection userMetaData;
- private int width;
- private int height;
- private Threading.ThreadPool threadPool = new Threading.ThreadPool();
- private Vector<Rectangle> updateRegion;
- private bool dirty;
- [NonSerialized]
- private Metadata metadata = null;
- public Metadata Metadata
- {
- get
- {
- if (metadata == null)
- {
- metadata = new Metadata(userMetaData);
- }
- return metadata;
- }
- }
- public MeasurementUnit DpuUnit
- {
- get
- {
- return DefaultDpuUnit;
- /*PropertyItem[] pis = this.Metadata.GetExifValues(ExifTagID.ResolutionUnit);
- if (pis.Length == 0)
- {
- this.DpuUnit = DefaultDpuUnit;
- return DefaultDpuUnit;
- }
- else
- {
- try
- {
- ushort unit = Exif.DecodeShortValue(pis[0]);
- // Guard against bad data in the EXIF store
- switch ((MeasurementUnit)unit)
- {
- case MeasurementUnit.Pixel:
- case MeasurementUnit.Inch:
- case MeasurementUnit.Centimeter:
- case MeasurementUnit.Millimeter:
- case MeasurementUnit.Micron:
- case MeasurementUnit.Nano:
- return (MeasurementUnit)unit;
- default:
- this.Metadata.RemoveExifValues(ExifTagID.ResolutionUnit);
- return this.DpuUnit;
- }
- }
- catch (Exception)
- {
- this.Metadata.RemoveExifValues(ExifTagID.ResolutionUnit);
- return this.DpuUnit;
- }
- }*/
- }
- set
- {
- /*PropertyItem pi = Exif.CreateShort(ExifTagID.ResolutionUnit, (ushort)value);
- this.Metadata.ReplaceExifValues(ExifTagID.ResolutionUnit, new PropertyItem[1] { pi });
- if (value == MeasurementUnit.Pixel)
- {
- this.DpuX = 1.0;
- this.DpuY = 1.0;
- }
- Dirty = true;*/
- }
- }
- public static MeasurementUnit DefaultDpuUnit
- {
- get
- {
- return MeasurementUnit.Inch;
- }
- }
- public static double defaultDpi = 96;
- public static double DefaultDpi
- {
- get
- {
- return defaultDpi;
- }
- }
- /// <summary>
- /// 1英寸 = 2.54厘米
- /// </summary>
- public static double CmPerInch = 2.54;
- /// <summary>
- /// 默认值 = dpi / 单位
- /// </summary>
- public double defaultDpcm;
- public const double MinimumDpu = 0.01;
- public const double MaximumDpu = 32767.0;
- public static double GetDefaultDpu(MeasurementUnit units)
- {
- double dpu;
- switch (units)
- {
- case MeasurementUnit.Inch:
- dpu = defaultDpi;
- break;
- case MeasurementUnit.Centimeter:
- dpu = defaultDpi / CmPerInch;
- break;
- case MeasurementUnit.Millimeter:
- dpu = defaultDpi / CmPerInch / 10;
- break;
- case MeasurementUnit.Micron:
- dpu = defaultDpi / CmPerInch / 10000;
- break;
- case MeasurementUnit.Nano:
- dpu = defaultDpi / CmPerInch / 10000000;
- break;
- case MeasurementUnit.Pixel:
- dpu = 1.0;
- break;
- default:
- throw new InvalidEnumArgumentException("DpuUnit", (int)units, typeof(MeasurementUnit));
- }
- return dpu;
- }
- public double DpuX
- {
- get
- {
- return this.DpuX;
- /*PropertyItem[] pis = this.Metadata.GetExifValues(ExifTagID.XResolution);
- if (pis.Length == 0)
- {
- double defaultDpu = GetDefaultDpu(this.DpuUnit);
- this.DpuX = defaultDpu;
- return defaultDpu;
- }
- else
- {
- try
- {
- uint numerator;
- uint denominator;
- Exif.DecodeRationalValue(pis[0], out numerator, out denominator);
- if (denominator == 0)
- {
- throw new DivideByZeroException(); // will be caught by the below catch{}
- }
- else
- {
- return Math.Min(MaximumDpu, Math.Max(MinimumDpu, (double)numerator / (double)denominator));
- }
- }
- catch
- {
- this.Metadata.RemoveExifValues(ExifTagID.XResolution);
- return this.DpuX; // recursive call;
- }
- }*/
- }
- set
- {
- if (value <= 0.0)
- {
- throw new ArgumentOutOfRangeException("value", value, "must be > 0.0");
- }
- if (this.DpuUnit == MeasurementUnit.Pixel && value != 1.0)
- {
- throw new ArgumentOutOfRangeException("value", value, "if DpuUnit == Pixel, then value must equal 1.0");
- }
- Dirty = true;
- }
- }
- public double DpuY
- {
- get
- {
- return this.DpuY;
- /*PropertyItem[] pis = this.Metadata.GetExifValues(ExifTagID.YResolution);
- if (pis.Length == 0)
- {
- // If there's no DpuY setting, default to the DpuX setting
- double dpu = this.DpuX;
- this.DpuY = dpu;
- return dpu;
- }
- else
- {
- try
- {
- uint numerator;
- uint denominator;
- Exif.DecodeRationalValue(pis[0], out numerator, out denominator);
- if (denominator == 0)
- {
- throw new DivideByZeroException();
- }
- else
- {
- return Math.Min(MaximumDpu, Math.Max(MinimumDpu, (double)numerator / (double)denominator));
- }
- }
- catch
- {
- return this.DpuY;
- }
- }*/
- }
- set
- {
- if (value <= 0.0)
- {
- throw new ArgumentOutOfRangeException("value", value, "must be > 0.0");
- }
- if (this.DpuUnit == MeasurementUnit.Pixel && value != 1.0)
- {
- throw new ArgumentOutOfRangeException("value", value, "if DpuUnit == Pixel, then value must equal 1.0");
- }
- Dirty = true;
- }
- }
- /// <summary>
- /// 像素换算到物理长度
- /// </summary>
- /// <param name="pixel"></param>
- /// <param name="resultUnit"></param>
- /// <returns></returns>
- public double PixelToPhysicalX(double pixel, MeasurementUnit resultUnit)
- {
- double result;
- if (resultUnit == MeasurementUnit.Pixel)
- {
- result = pixel;
- }
- else
- {
- MeasurementUnit dpuUnit = this.DpuUnit;
- if (resultUnit == dpuUnit)
- {
- result = pixel / this.DpuX;
- }
- else if (dpuUnit == MeasurementUnit.Pixel)
- {
- double defaultDpuX = GetDefaultDpu(dpuUnit);
- result = pixel / defaultDpuX;
- }
- else if (dpuUnit == MeasurementUnit.Centimeter && resultUnit == MeasurementUnit.Inch)
- {
- result = pixel / this.DpuX; // (CmPerInch * this.DpuX);
- }
- else if (dpuUnit == MeasurementUnit.Inch && resultUnit == MeasurementUnit.Millimeter)
- {
- double defaultDpuY = GetDefaultDpu(MeasurementUnit.Millimeter);
- result = pixel / defaultDpuY;
- }
- else if (dpuUnit == MeasurementUnit.Inch && resultUnit == MeasurementUnit.Micron)
- {
- double defaultDpuY = GetDefaultDpu(MeasurementUnit.Micron);
- result = pixel / defaultDpuY;
- }
- else if (dpuUnit == MeasurementUnit.Inch && resultUnit == MeasurementUnit.Nano)
- {
- double defaultDpuY = GetDefaultDpu(MeasurementUnit.Nano);
- result = pixel / defaultDpuY;
- }
- else
- {
- result = pixel / this.DpuX; //(pixel * CmPerInch) / this.DpuX;
- }
- }
- return result;
- }
- /// <summary>
- /// 像素换算到物理长度
- /// </summary>
- /// <param name="pixel"></param>
- /// <param name="resultUnit"></param>
- /// <returns></returns>
- public double PixelToPhysicalY(double pixel, MeasurementUnit resultUnit)
- {
- double result;
- if (resultUnit == MeasurementUnit.Pixel)
- {
- result = pixel;
- }
- else
- {
- MeasurementUnit dpuUnit = this.DpuUnit;
- if (resultUnit == dpuUnit)
- {
- double defaultDpuY = GetDefaultDpu(dpuUnit);
- result = pixel / defaultDpuY;
- //result = pixel / this.DpuY;
- }
- else if (dpuUnit == MeasurementUnit.Pixel)
- {
- double defaultDpuY = GetDefaultDpu(dpuUnit);
- result = pixel / defaultDpuY;
- }
- else if (dpuUnit == MeasurementUnit.Inch && resultUnit == MeasurementUnit.Centimeter)
- {
- double defaultDpuY = GetDefaultDpu(MeasurementUnit.Centimeter);
- result = pixel / defaultDpuY; // pixel / (CmPerInch * this.DpuY);
- }
- else if (dpuUnit == MeasurementUnit.Inch && resultUnit == MeasurementUnit.Millimeter)
- {
- double defaultDpuY = GetDefaultDpu(MeasurementUnit.Millimeter);
- result = pixel / defaultDpuY;
- }
- else if (dpuUnit == MeasurementUnit.Inch && resultUnit == MeasurementUnit.Micron)
- {
- double defaultDpuY = GetDefaultDpu(MeasurementUnit.Micron);
- result = pixel / defaultDpuY;
- }
- else if (dpuUnit == MeasurementUnit.Inch && resultUnit == MeasurementUnit.Nano)
- {
- double defaultDpuY = GetDefaultDpu(MeasurementUnit.Nano);
- result = pixel / defaultDpuY;
- }
- else
- {
- result = pixel / this.DpuX;//(pixel * CmPerInch) / this.DpuY;
- }
- }
- return result;
- }
- private static string GetUnitsAbbreviation(MeasurementUnit units)
- {
- string result;
- switch (units)
- {
- case MeasurementUnit.Pixel:
- result = string.Empty;
- break;
- case MeasurementUnit.Inch:
- result = PdnResources.GetString("MeasurementUnit.Inch.Abbreviation");
- break;
- case MeasurementUnit.Centimeter:
- result = PdnResources.GetString("MeasurementUnit.Centimeter.Abbreviation");
- break;
- case MeasurementUnit.Millimeter:
- result = PdnResources.GetString("MeasurementUnit.Centimeter.Abbreviation");
- break;
- case MeasurementUnit.Micron:
- result = PdnResources.GetString("MeasurementUnit.Centimeter.Abbreviation");
- break;
- case MeasurementUnit.Nano:
- result = PdnResources.GetString("MeasurementUnit.Centimeter.Abbreviation");
- break;
- default:
- throw new InvalidEnumArgumentException("MeasurementUnit was invalid");
- }
- return result;
- }
- public void CoordinatesToStrings(MeasurementUnit units, int x, int y, out string xString, out string yString, out string unitsString)
- {
- unitsString = GetUnitsAbbreviation(units);
- if (units == MeasurementUnit.Pixel)
- {
- xString = x.ToString();
- yString = y.ToString();
- }
- else
- {
- double physicalX = PixelToPhysicalX(x, units);
- xString = physicalX.ToString("F2");
- double physicalY = PixelToPhysicalY(y, units);
- yString = physicalY.ToString("F2");
- }
- }
- [field: NonSerialized]
- public event EventHandler DirtyChanged;
- private void OnDirtyChanged()
- {
- if (DirtyChanged != null)
- {
- DirtyChanged(this, EventArgs.Empty);
- }
- }
- public bool Dirty
- {
- get
- {
- if (this.disposed)
- {
- throw new ObjectDisposedException("Document");
- }
- return this.dirty;
- }
- set
- {
- if (this.disposed)
- {
- throw new ObjectDisposedException("Document");
- }
- if (this.dirty != value)
- {
- this.dirty = value;
- OnDirtyChanged();
- }
- }
- }
- public int Width
- {
- get
- {
- return width;
- }
- }
- public int Height
- {
- get
- {
- return height;
- }
- }
- public Size Size
- {
- get
- {
- return new Size(Width, Height);
- }
- }
- public Document(int width, int height)
- {
- this.width = width;
- this.height = height;
- this.Dirty = true;
- this.updateRegion = new Vector<Rectangle>();
- Invalidate();
- }
- [field: NonSerialized]
- public event InvalidateEventHandler Invalidated;
- private void OnInvalidated(InvalidateEventArgs e)
- {
- if (Invalidated != null)
- {
- Invalidated(this, e);
- }
- }
- public void Invalidate()
- {
- Dirty = true;
- Rectangle rect = new Rectangle(0, 0, Width, Height);
- updateRegion.Clear();
- updateRegion.Add(rect);
- OnInvalidated(new InvalidateEventArgs(rect));
- }
- /// <summary>
- /// Creates a document that consists of one BitmapLayer.
- /// </summary>
- /// <param name="image">The Image to make a copy of that will be the first layer ("Background") in the document.</param>
- public static Document FromImage(Image image)
- {
- if (image == null)
- {
- throw new ArgumentNullException("image");
- }
- Document document = new Document(image.Width, image.Height);
- Surface surface = new Surface(new Size(image.Width, image.Height));
- surface.Clear(ColorBgra.FromBgra(0, 0, 0, 0));
- surface.PixelFormat = image.PixelFormat;
- //BitmapLayer layer = Layer.CreateBackgroundLayer(image.Width, image.Height);
- //layer.Surface.Clear(ColorBgra.FromBgra(0, 0, 0, 0));
- //layer.Surface.PixelFormat = image.PixelFormat;
- Bitmap asBitmap = image as Bitmap;
- // Copy pixels
- if (asBitmap != null && asBitmap.PixelFormat == PixelFormat.Format32bppArgb)
- {
- unsafe
- {
- BitmapData bData = asBitmap.LockBits(new Rectangle(0, 0, asBitmap.Width, asBitmap.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
- try
- {
- for (int y = 0; y < bData.Height; ++y)
- {
- uint* srcPtr = (uint*)((byte*)bData.Scan0.ToPointer() + (y * bData.Stride));
- ColorBgra* dstPtr = surface.GetRowAddress(y);
- for (int x = 0; x < bData.Width; ++x)
- {
- dstPtr->Bgra = *srcPtr;
- ++srcPtr;
- ++dstPtr;
- }
- }
- }
- finally
- {
- asBitmap.UnlockBits(bData);
- bData = null;
- }
- }
- }
- else if (asBitmap != null && asBitmap.PixelFormat == PixelFormat.Format24bppRgb)
- {
- unsafe
- {
- BitmapData bData = asBitmap.LockBits(new Rectangle(0, 0, asBitmap.Width, asBitmap.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
- try
- {
- for (int y = 0; y < bData.Height; ++y)
- {
- byte* srcPtr = (byte*)bData.Scan0.ToPointer() + (y * bData.Stride);
- ColorBgra* dstPtr = surface.GetRowAddress(y);
- for (int x = 0; x < bData.Width; ++x)
- {
- byte b = *srcPtr;
- byte g = *(srcPtr + 1);
- byte r = *(srcPtr + 2);
- byte a = 255;
- *dstPtr = ColorBgra.FromBgra(b, g, r, a);
- srcPtr += 3;
- ++dstPtr;
- }
- }
- }
- finally
- {
- asBitmap.UnlockBits(bData);
- bData = null;
- }
- }
- }
- else
- {
- using (RenderArgs args = new RenderArgs(surface))
- {
- args.Graphics.CompositingMode = CompositingMode.SourceCopy;
- args.Graphics.SmoothingMode = SmoothingMode.None;
- args.Graphics.DrawImage(image, args.Bounds, args.Bounds, GraphicsUnit.Pixel);
- }
- }
- // Transfer metadata
- // Sometimes GDI+ does not honor the resolution tags that we
- // put in manually via the EXIF properties.
- document.DpuUnit = MeasurementUnit.Inch;
- document.DpuX = image.HorizontalResolution;
- document.DpuY = image.VerticalResolution;
- PropertyItem[] pis;
- try
- {
- pis = image.PropertyItems;
- }
- catch (Exception ex)
- {
- //Tracing.Ping("Exception while retreiving image's PropertyItems: " + ex.ToString());
- pis = null;
- }
- //if (pis != null)
- //{
- // for (int i = 0; i < pis.Length; ++i)
- // {
- // document.Metadata.AddExifValues(new PropertyItem[] { pis[i] });
- // }
- //}
- //document.Layers.Add(layer);
- document.surface = surface;
- document.Invalidate();
- return document;
- }
- public static Document FromMat(OpenCvSharp.Mat mat)
- {
- if (mat == null)
- {
- throw new ArgumentNullException("image");
- }
- Image image = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(mat);
- Bitmap asBitmap = image as Bitmap;
- Document document = new Document(mat.Width, mat.Height);
- Surface surface = new Surface(new Size(mat.Width, mat.Height));
- surface.Clear(ColorBgra.FromBgra(0, 0, 0, 0));
- // Copy pixels
- if (asBitmap != null && asBitmap.PixelFormat == PixelFormat.Format32bppArgb)
- {
- unsafe
- {
- BitmapData bData = asBitmap.LockBits(new Rectangle(0, 0, asBitmap.Width, asBitmap.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb);
- try
- {
- for (int y = 0; y < bData.Height; ++y)
- {
- uint* srcPtr = (uint*)((byte*)bData.Scan0.ToPointer() + (y * bData.Stride));
- ColorBgra* dstPtr = surface.GetRowAddress(y);
- for (int x = 0; x < bData.Width; ++x)
- {
- dstPtr->Bgra = *srcPtr;
- ++srcPtr;
- ++dstPtr;
- }
- }
- }
- finally
- {
- asBitmap.UnlockBits(bData);
- bData = null;
- }
- }
- }
- else if (asBitmap != null && asBitmap.PixelFormat == PixelFormat.Format24bppRgb)
- {
- unsafe
- {
- BitmapData bData = asBitmap.LockBits(new Rectangle(0, 0, asBitmap.Width, asBitmap.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb);
- try
- {
- for (int y = 0; y < bData.Height; ++y)
- {
- byte* srcPtr = (byte*)bData.Scan0.ToPointer() + (y * bData.Stride);
- ColorBgra* dstPtr = surface.GetRowAddress(y);
- for (int x = 0; x < bData.Width; ++x)
- {
- byte b = *srcPtr;
- byte g = *(srcPtr + 1);
- byte r = *(srcPtr + 2);
- byte a = 255;
- *dstPtr = ColorBgra.FromBgra(b, g, r, a);
- srcPtr += 3;
- ++dstPtr;
- }
- }
- }
- finally
- {
- asBitmap.UnlockBits(bData);
- bData = null;
- }
- }
- }
- else
- {
- using (RenderArgs args = new RenderArgs(surface))
- {
- args.Graphics.CompositingMode = CompositingMode.SourceCopy;
- args.Graphics.SmoothingMode = SmoothingMode.None;
- args.Graphics.DrawImage(image, args.Bounds, args.Bounds, GraphicsUnit.Pixel);
- }
- }
- document.DpuUnit = MeasurementUnit.Inch;
- document.DpuX = image.HorizontalResolution;
- document.DpuY = image.VerticalResolution;
- document.surface = surface;
- document.Invalidate();
- return document;
- }
- ~Document()
- {
- Dispose(false);
- }
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
- private bool disposed = false;
- private void Dispose(bool disposing)
- {
- if (!disposed)
- {
- if (disposing)
- {
- /*foreach (Layer layer in layers)
- {
- layer.Dispose();
- }*/
- }
- disposed = true;
- }
- }
- public void Render(RenderArgs args, bool clearBackground)
- {
- Render(args, args.Surface.Bounds, clearBackground);
- }
- /// <summary>
- /// Renders a requested region of the document. Will clear the background of the input
- /// before rendering if requested.
- /// </summary>
- /// <param name="args">Contains information used to control where rendering occurs.</param>
- /// <param name="roi">The rectangular region to render.</param>
- /// <param name="clearBackground">If true, 'args' will be cleared to zero before rendering.</param>
- public void Render(RenderArgs args, Rectangle roi, bool clearBackground)
- {
- /*int startIndex;
- if (clearBackground)
- {
- BitmapLayer layer0;
- layer0 = this.layers[0] as BitmapLayer;
- // Special case: if the first layer is a visible BitmapLayer with full opacity using
- // the default blend op, we can just copy the pixels straight over
- if (layer0 != null &&
- layer0.Visible &&
- layer0.Opacity == 255 &&
- layer0.BlendOp.GetType() == UserBlendOps.GetDefaultBlendOp())
- {
- args.Surface.CopySurface(layer0.Surface);
- startIndex = 1;
- }
- else
- {
- ClearBackground(args.Surface, roi);
- startIndex = 0;
- }
- }
- else
- {
- startIndex = 0;
- }
- for (int i = startIndex; i < this.layers.Count; ++i)
- {
- Layer layer = (Layer)this.layers[i];
- if (layer.Visible)
- {
- layer.Render(args, roi);
- }
- }*/
- }
- public void Render(RenderArgs args, Rectangle[] roi, int startIndex, int length, bool clearBackground)
- {
- /*int startLayerIndex;
- if (clearBackground)
- {
- BitmapLayer layer0;
- layer0 = this.layers[0] as BitmapLayer;
- // Special case: if the first layer is a visible BitmapLayer with full opacity using
- // the default blend op, we can just copy the pixels straight over
- if (layer0 != null &&
- layer0.Visible &&
- layer0.Opacity == 255 &&
- layer0.BlendOp.GetType() == UserBlendOps.GetDefaultBlendOp())
- {
- args.Surface.CopySurface(layer0.Surface, roi, startIndex, length);
- startLayerIndex = 1;
- }
- else
- {
- ClearBackground(args.Surface, roi, startIndex, length);
- startLayerIndex = 0;
- }
- }
- else
- {
- startLayerIndex = 0;
- }
- for (int i = startLayerIndex; i < this.layers.Count; ++i)
- {
- Layer layer = (Layer)this.layers[i];
- if (layer.Visible)
- {
- layer.RenderUnchecked(args, roi, startIndex, length);
- }
- }*/
- }
- public static double DotsPerCmToDotsPerInch(double dpcm)
- {
- return dpcm * CmPerInch;
- }
- }
- }
|