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 (this.outputTileType == OutputTileType.IPIC) { if (transparentness == GDIBigLockedImage.Transparentness.EntirelyOpaque) { this.outputTileType = OutputTileType.JPG; } else { this.outputTileType = OutputTileType.PNG; } } RenderOutputUtil.SaveImage(imageRef, this.renderOutput, this.outputFilename, this.outputTileType.imageFormat); } this.feedback.PostImageResult(imageRef, this.layer, "(composite)", this.address); imageRef.Dispose(); } catch (Exception arg) { this.feedback.PostMessage(string.Format("Can't create {0}: {1}", this.outputFilename, arg)); } }
//[CompilerGenerated] //private static Predicate<ImageCodecInfo> <>9__CachedAnonymousMethodDelegate1; public CompositeTileUnit(Layer layer, TileAddress address, RenderOutputMethod renderOutput, string outputFilename, OutputTileType outputTileType) { this.layer = layer; this.address = address; this.renderOutput = renderOutput; this.outputFilename = outputFilename; this.outputTileType = outputTileType; }
public RenderOptions(MashupParseContext context, DirtyEvent parentDirtyEvent, ref SingleMaxZoomForEntireMashupCompatibilityBlob blob) { dirtyEvent = new DirtyEvent(parentDirtyEvent); XMLTagReader xMLTagReader = context.NewTagReader(RenderOptionsTag); while (xMLTagReader.FindNextStartTag()) { if (context.version == SingleMaxZoomForEntireMashupSchema.schema && xMLTagReader.TagIs(SingleMaxZoomForEntireMashupSchema.ZoomLevelsTag)) { blob = new SingleMaxZoomForEntireMashupCompatibilityBlob(); XMLTagReader xMLTagReader2 = context.NewTagReader(SingleMaxZoomForEntireMashupSchema.ZoomLevelsTag); string attribute; if ((attribute = context.reader.GetAttribute(SingleMaxZoomForEntireMashupSchema.MinZoomTag)) != null) { blob.minZoom = MercatorCoordinateSystem.theInstance.GetZoomRange().Parse(context, SingleMaxZoomForEntireMashupSchema.MinZoomTag, attribute); } if ((attribute = context.reader.GetAttribute(SingleMaxZoomForEntireMashupSchema.MaxZoomTag)) != null) { blob.maxZoom = MercatorCoordinateSystem.theInstance.GetZoomRange().Parse(context, SingleMaxZoomForEntireMashupSchema.MaxZoomTag, attribute); } xMLTagReader2.SkipAllSubTags(); } else { if (xMLTagReader.TagIs(RenderToFileOptions.xmlTag)) { _renderToOptions = new RenderToFileOptions(context, dirtyEvent); } else { if (xMLTagReader.TagIs(compatibility_RenderToFileOutputTag)) { _renderToOptions = new RenderToFileOptions(context, dirtyEvent, compatibility_RenderToFileOutputTag); } else { if (xMLTagReader.TagIs(RenderToS3Options.xmlTag)) { _renderToOptions = new RenderToS3Options(context, dirtyEvent); } else { if (xMLTagReader.TagIs(OutputTileTypeTag)) { XMLTagReader xMLTagReader3 = context.NewTagReader(OutputTileTypeTag); outputTileType = OutputTileType.Parse(context.reader.GetAttribute(OutputTileTypeAttr)); xMLTagReader3.SkipAllSubTags(); } else { if (xMLTagReader.TagIs(PublishSourceDataTag)) { XMLTagReader xMLTagReader4 = context.NewTagReader(PublishSourceDataTag); publishSourceData = context.GetRequiredAttributeBoolean(PublishSourceDataValueAttr); xMLTagReader4.SkipAllSubTags(); } else { if (xMLTagReader.TagIs(PermitCompositionTag)) { XMLTagReader xMLTagReader5 = context.NewTagReader(PermitCompositionTag); permitComposition = context.GetRequiredAttributeBoolean(PermitCompositionValueAttr); xMLTagReader5.SkipAllSubTags(); } } } } } } } } }
public RenderOptions(MashupParseContext context, DirtyEvent parentDirtyEvent, ref SingleMaxZoomForEntireMashupCompatibilityBlob blob) { this.dirtyEvent = new DirtyEvent(parentDirtyEvent); XMLTagReader xMLTagReader = context.NewTagReader(RenderOptions.RenderOptionsTag); while (xMLTagReader.FindNextStartTag()) { if (context.version == SingleMaxZoomForEntireMashupSchema.schema && xMLTagReader.TagIs(SingleMaxZoomForEntireMashupSchema.ZoomLevelsTag)) { blob = new SingleMaxZoomForEntireMashupCompatibilityBlob(); XMLTagReader xMLTagReader2 = context.NewTagReader(SingleMaxZoomForEntireMashupSchema.ZoomLevelsTag); string attribute; if ((attribute = context.reader.GetAttribute(SingleMaxZoomForEntireMashupSchema.MinZoomTag)) != null) { blob.minZoom = MercatorCoordinateSystem.theInstance.GetZoomRange().Parse(context, SingleMaxZoomForEntireMashupSchema.MinZoomTag, attribute); } if ((attribute = context.reader.GetAttribute(SingleMaxZoomForEntireMashupSchema.MaxZoomTag)) != null) { blob.maxZoom = MercatorCoordinateSystem.theInstance.GetZoomRange().Parse(context, SingleMaxZoomForEntireMashupSchema.MaxZoomTag, attribute); } xMLTagReader2.SkipAllSubTags(); } else { if (xMLTagReader.TagIs(RenderToFileOptions.xmlTag)) { this._renderToOptions = new RenderToFileOptions(context, this.dirtyEvent); } else { if (xMLTagReader.TagIs(RenderOptions.compatibility_RenderToFileOutputTag)) { this._renderToOptions = new RenderToFileOptions(context, this.dirtyEvent, RenderOptions.compatibility_RenderToFileOutputTag); } else { if (xMLTagReader.TagIs(RenderToS3Options.xmlTag)) { this._renderToOptions = new RenderToS3Options(context, this.dirtyEvent); } else { if (xMLTagReader.TagIs(RenderOptions.OutputTileTypeTag)) { XMLTagReader xMLTagReader3 = context.NewTagReader(RenderOptions.OutputTileTypeTag); this._outputTileType = OutputTileType.Parse(context.reader.GetAttribute(RenderOptions.OutputTileTypeAttr)); xMLTagReader3.SkipAllSubTags(); } else { if (xMLTagReader.TagIs(RenderOptions.PublishSourceDataTag)) { XMLTagReader xMLTagReader4 = context.NewTagReader(RenderOptions.PublishSourceDataTag); this.publishSourceData = context.GetRequiredAttributeBoolean(RenderOptions.PublishSourceDataValueAttr); xMLTagReader4.SkipAllSubTags(); } else { if (xMLTagReader.TagIs(RenderOptions.PermitCompositionTag)) { XMLTagReader xMLTagReader5 = context.NewTagReader(RenderOptions.PermitCompositionTag); this.permitComposition = context.GetRequiredAttributeBoolean(RenderOptions.PermitCompositionValueAttr); xMLTagReader5.SkipAllSubTags(); } } } } } } } } }