本文整理汇总了C#中PaintDotNet.Surface类的典型用法代码示例。如果您正苦于以下问题:C# Surface类的具体用法?C# Surface怎么用?C# Surface使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Surface类属于PaintDotNet命名空间,在下文中一共展示了Surface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Apply
public void Apply(Surface dst, Surface src, Rectangle[] rois, int startIndex, int length)
{
for (int i = startIndex; i < startIndex + length; ++i)
{
ApplyBase(dst, rois[i].Location, src, rois[i].Location, rois[i].Size);
}
}
示例2: FitSurfaceContext
public FitSurfaceContext(Surface dstSurface, Surface srcSurface, Rectangle[] dstRois, ResamplingAlgorithm algorithm)
{
this.dstSurface = dstSurface;
this.srcSurface = srcSurface;
this.dstRois = dstRois;
this.algorithm = algorithm;
}
示例3: GradientBenchmark
public GradientBenchmark(string name, Surface surface, GradientRenderer renderer, int iterations)
: base(name)
{
this.surface = surface;
this.renderer = renderer;
this.iterations = iterations;
}
示例4: MyRender
private void MyRender(Surface dst, Surface src)
{
PdnRegion selectionRegion = EnvironmentParameters.GetSelection(src.Bounds);
ColorBgra PrimaryColor = (ColorBgra)EnvironmentParameters.PrimaryColor;
ColorBgra SecondaryColor = (ColorBgra)EnvironmentParameters.SecondaryColor;
int BrushWidth = (int)EnvironmentParameters.BrushWidth;
if (PGP.Length > 0 && Draw )
{
using (Graphics g = new RenderArgs(dst).Graphics)
{
using (Region reg = new Region(selectionRegion.GetRegionData()))
{
g.SetClip(reg, CombineMode.Replace);
}
g.SmoothingMode = SmoothingMode.AntiAlias;
Pen p = new Pen(PrimaryColor);
p.Width = BrushWidth;
for (int i = 0; i < PGP.Length; i++)
{
if (PGP[i].PointCount > 0)
{
g.DrawPath(p, PGP[i]);
}
}
}
}
}
示例5: RenderCompositionTo
protected void RenderCompositionTo(Surface dst, bool highQuality, bool forceUpToDate)
{
if (forceUpToDate)
{
UpdateComposition(false);
}
if (dst.Width == this.compositionSurface.Width &&
dst.Height == this.compositionSurface.Height)
{
dst.ClearWithCheckboardPattern();
new UserBlendOps.NormalBlendOp().Apply(dst, this.compositionSurface);
}
else if (highQuality)
{
Surface thumb = new Surface(dst.Size);
thumb.SuperSamplingFitSurface(this.compositionSurface);
dst.ClearWithCheckboardPattern();
new UserBlendOps.NormalBlendOp().Apply(dst, thumb);
thumb.Dispose();
}
else
{
this.surfaceBox.RenderTo(dst);
}
}
示例6: ZoomOutBlitBenchmark
public ZoomOutBlitBenchmark(string name, Surface source, Surface dst, Size blitSize)
: base(name)
{
this.source = source;
this.dst = dst;
this.blitSize = blitSize;
}
示例7: BitmapLayer
public BitmapLayer(int width, int height, ColorBgra fillColor)
: base(width, height)
{
this.surface = new Surface(width, height);
// clear to see-through white, 0x00ffffff
this.Surface.Clear(fillColor);
this.properties = new BitmapLayerProperties(UserBlendOps.CreateDefaultBlendOp());
}
示例8: OnSave
protected override void OnSave(Document input, Stream output, SaveConfigToken token,
Surface scratchSurface, ProgressEventHandler callback)
{
RenderArgs ra = new RenderArgs(new Surface(input.Size));
input.Render(ra);
ra.Bitmap.Save(output, ImageFormat.Bmp);
}
示例9: EffectBenchmark
public EffectBenchmark(string name, int iterations, Effect effect, EffectConfigToken token, Surface image)
: base(name + " (" + iterations + "x)")
{
this.effect = effect;
this.token = token;
this.image = image;
this.iterations = iterations;
}
示例10: TransformBenchmark
public TransformBenchmark(string name, Surface dst, MaskedSurface src, Matrix transform, bool highQuality)
: base(name)
{
this.dst = dst;
this.src = src;
this.transform = transform.Clone();
this.highQuality = highQuality;
}
示例11: CompositionBenchmark
public CompositionBenchmark(string name, Document composeMe,
Surface dstSurface, SetLayerInfoDelegate sliDelegate)
: base(name)
{
this.composeMe = composeMe;
this.dstSurface = dstSurface;
this.sliDelegate = sliDelegate;
}
示例12: ApplyRectangle
private unsafe void ApplyRectangle(Surface surface, Rectangle rect)
{
for (int y = rect.Top; y < rect.Bottom; ++y)
{
ColorBgra *ptr = surface.GetPointAddress(rect.Left, y);
Apply(ptr, rect.Width);
}
}
示例13: Draw
public void Draw(Surface dst)
{
if (disposed)
{
throw new ObjectDisposedException("PlacedSurface");
}
dst.CopySurface(what, where);
}
示例14: Save
public void Save(Stream dstStream, Document srcDocument, FileType dstFileType, SaveConfigToken parameters, Surface saveScratchSurface)
{
this.document = srcDocument;
this.fileType = dstFileType;
this.stream = dstStream;
this.saveConfigToken = parameters;
this.scratchSurface = saveScratchSurface;
DialogResult dr = this.ShowDialog(false, !dstFileType.SavesWithProgress , new ThreadStart(SaveCallback));
}
示例15: PlacedSurface
public PlacedSurface(Surface source, Rectangle roi)
{
where = roi.Location;
Surface window = source.CreateWindow(roi);
what = new Surface(window.Size);
what.CopySurface(window);
window.Dispose();
}