예제 #1
0
파일: Legend.cs 프로젝트: ymx0627/GMap.NET
        public IFuture GetRenderedLegendFuture(IDisplayableSource displayableSource, FutureFeatures features)
        {
            RenderRegion renderRegion = latentRegionHolder.renderRegion;

            if (renderRegion == null)
            {
                throw new RenderFailedException("Region unavailable");
            }

            renderRegion = renderRegion.Copy(new DirtyEvent());
            MapRectangleParameter mapRectangleParameter = new MapRectangleParameter(renderRegion.GetBoundingBox());
            Size             outputSize     = OutputSizeFromRenderRegion(renderRegion);
            IFuturePrototype imagePrototype =
                displayableSource.GetImagePrototype(new ImageParameterFromRawBounds(outputSize), features);

            return(imagePrototype.Curry(new ParamDict(new object[] { TermName.ImageBounds, mapRectangleParameter })));
        }
예제 #2
0
파일: Legend.cs 프로젝트: gabilic/Oplan
        private Size OutputSizeFromRenderRegion(RenderRegion renderRegion)
        {
            MapRectangleParameter mapRectangleParameter = new MapRectangleParameter(renderRegion.GetBoundingBox());

            return(mapRectangleParameter.value.SizeWithAspectRatio(this.renderedSize));
        }
예제 #3
0
파일: Legend.cs 프로젝트: mikhp/greatmaps
		private Size OutputSizeFromRenderRegion(RenderRegion renderRegion)
		{
			MapRectangleParameter mapRectangleParameter = new MapRectangleParameter(renderRegion.GetBoundingBox());
			return mapRectangleParameter.value.SizeWithAspectRatio(this.renderedSize);
		}
예제 #4
0
파일: Legend.cs 프로젝트: mikhp/greatmaps
		public IFuture GetRenderedLegendFuture(IDisplayableSource displayableSource, FutureFeatures features)
		{
			RenderRegion renderRegion = this.latentRegionHolder.renderRegion;
			if (renderRegion == null)
			{
				throw new Legend.RenderFailedException("Region unavailable");
			}
			renderRegion = renderRegion.Copy(new DirtyEvent());
			MapRectangleParameter mapRectangleParameter = new MapRectangleParameter(renderRegion.GetBoundingBox());
			Size outputSize = this.OutputSizeFromRenderRegion(renderRegion);
			IFuturePrototype imagePrototype = displayableSource.GetImagePrototype(new ImageParameterFromRawBounds(outputSize), features);
			return imagePrototype.Curry(new ParamDict(new object[]
			{
				TermName.ImageBounds,
				mapRectangleParameter
			}));
		}