public override bool DoWork(ITileWorkFeedback feedback) { if (!this.needThisTile()) { return false; } D.Sayf(10, "SingleSourcing {0} {1}", new object[] { this.applier.source.GetSourceMapDisplayName(), this.address }); Present present = this.FetchClippedImage(); if (present is ImageRef) { ImageRef image = (ImageRef)present; feedback.PostImageResult(image, this.applier.layer, this.applier.source.GetSourceMapDisplayName(), this.address); } present.Dispose(); return true; }
public override bool DoWork(ITileWorkFeedback feedback) { if (!this.needThisTile()) { return(false); } D.Sayf(10, "SingleSourcing {0} {1}", new object[] { this.applier.source.GetSourceMapDisplayName(), this.address }); Present present = this.FetchClippedImage(); if (present is ImageRef) { ImageRef image = (ImageRef)present; feedback.PostImageResult(image, this.applier.layer, this.applier.source.GetSourceMapDisplayName(), this.address); } present.Dispose(); return(true); }
private void SaveTile(GDIBigLockedImage compositeImage) { try { ImageRef imageRef = new ImageRef(new ImageRefCounted(compositeImage)); GDIBigLockedImage.Transparentness transparentness = imageRef.image.GetTransparentness(); if (transparentness == GDIBigLockedImage.Transparentness.EntirelyTransparent) { D.Sayf(0, "skipping blank tile.", new object[0]); } else { if (outputTileType == OutputTileType.IPIC) { if (transparentness == GDIBigLockedImage.Transparentness.EntirelyOpaque) { outputTileType = OutputTileType.JPG; } else { outputTileType = OutputTileType.PNG; } } RenderOutputUtil.SaveImage(imageRef, renderOutput, outputFilename, outputTileType.imageFormat); } feedback.PostImageResult(imageRef, layer, "(composite)", address); imageRef.Dispose(); } catch (Exception arg) { feedback.PostMessage(string.Format("Can't create {0}: {1}", outputFilename, arg)); } }