/// <summary>
		/// Cloning constructor.
		/// </summary>
		protected CompositeImageGraphic(CompositeImageGraphic source, ICloningContext context)
		{
			context.CloneFields(source, this);
		}
Example #2
0
 /// <summary>
 /// Cloning constructor.
 /// </summary>
 protected CompositeImageGraphic(CompositeImageGraphic source, ICloningContext context)
 {
     context.CloneFields(source, this);
 }
		private void CreateImageLayer(ImageTypes imageType)
		{
			if (imageType == ImageTypes.Mono16)
				_image = new GrayscaleImageGraphic(_srcHeight, _srcWidth, 16, 16, 15, false, false, 1.9, 3, new byte[2 * _srcWidth * _srcHeight]);
			else if (imageType == ImageTypes.Mono8)
				_image = new GrayscaleImageGraphic(_srcHeight, _srcWidth, 8, 8, 7, false, false, 1.0, 0, new byte[_srcWidth * _srcHeight]);
			if (imageType == ImageTypes.Mono16Signed)
				_image = new GrayscaleImageGraphic(_srcHeight, _srcWidth, 16, 16, 15, true, false, 2.0, -630, new byte[2 * _srcWidth * _srcHeight]);
			else if (imageType == ImageTypes.Mono8Signed)
				_image = new GrayscaleImageGraphic(_srcHeight, _srcWidth, 8, 8, 7, true, false, 0.5, 4, new byte[_srcWidth * _srcHeight]);
			else
				_image = new ColorImageGraphic(_srcHeight, _srcWidth, new byte[4 * _srcWidth * _srcHeight]);

			if (_image is GrayscaleImageGraphic)
			{
				(_image as IColorMapInstaller).InstallColorMap(new GrayscaleColorMap());
			}

			_containerGraphic = new CompositeImageGraphic(_image.Rows, _image.Columns);
			_containerGraphic.Graphics.Add(_image);

			ImageSpatialTransform transform = (ImageSpatialTransform)_containerGraphic.SpatialTransform;
			transform.Initialize();
			transform.ClientRectangle = new Rectangle(0, 0, _dstWidth, _dstHeight);
			transform.ScaleToFit = _scaleToFit;
			transform.Scale = _scale;
			transform.FlipX = _flipHorizontal;
			transform.FlipY = _flipVertical;
			transform.RotationXY = _rotation;
			transform.TranslationX = _translationX;
			transform.TranslationY = _translationY;
		}