Esempio n. 1
0
		public DziImageTile(ImageProviderBase image, DziImageRequest imageRequest,
			int tilePixelDimension, int overlap, string format)
		{
			_image = image;
			_imageRequest = imageRequest;
			_level = imageRequest.Level;
			_tilePixelDimension = tilePixelDimension;
		}
Esempio n. 2
0
		public void ServeDziImageTile(HttpContext context)
		{
			DziImageRequest request = new DziImageRequest(context.Request.Url);
			Collection collection = _collectionCache.Get(request.CollectionKey);
			if (collection == null)
			{
				ServeStaticFile(context, "image/jpeg");
				return;
			}

			CollectionItem item = collection.Items[request.ItemId];
			ImageProviderBase image = item.ImageProvider;

			DziImageTile imageTile = new DziImageTile(image, request,
				DziSerializer.DefaultTileSize, DziSerializer.DefaultOverlap, DziSerializer.DefaultFormat);
			imageTile.Write(context.Response);
		}