Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <c>Image</c> class.
        /// </summary>
        /// <param name="imageDefinition">Image definition.</param>
        /// <param name="position">Image <see cref="Vector3">position</see> in world coordinates.</param>
        /// <param name="width">Image width in world coordinates.</param>
        /// <param name="height">Image height in world coordinates.</param>
        public Image(ImageDefinition imageDefinition, Vector3 position, double width, double height)
            : base(EntityType.Image, DxfObjectCode.Image)
        {
            if (imageDefinition == null)
            {
                throw new ArgumentNullException("imageDefinition");
            }

            this.imageDefinition = imageDefinition;
            this.position        = position;
            if (width <= 0)
            {
                throw new ArgumentOutOfRangeException("width", width, "The Image width must be greater than zero.");
            }
            this.width = width;
            if (height <= 0)
            {
                throw new ArgumentOutOfRangeException("height", height, "The Image height must be greater than zero.");
            }
            this.height           = height;
            this.rotation         = 0;
            this.clipping         = false;
            this.brightness       = 50;
            this.contrast         = 50;
            this.fade             = 0;
            this.displayOptions   = ImageDisplayFlags.ShowImage | ImageDisplayFlags.ShowImageWhenNotAlignedWithScreen | ImageDisplayFlags.UseClippingBoundary;
            this.clippingBoundary = new ClippingBoundary(0, 0, imageDefinition.Width, imageDefinition.Height);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <c>Image</c> class.
 /// </summary>
 /// <param name="imageDefinition">Image definition.</param>
 /// <param name="position">Image <see cref="Vector3">position</see> in world coordinates.</param>
 /// <param name="width">Image width in world coordinates.</param>
 /// <param name="height">Image height in world coordinates.</param>
 public Image(ImageDefinition imageDefinition, Vector3 position, double width, double height)
     : base(EntityType.Image, DxfObjectCode.Image)
 {
     this.imageDefinition  = imageDefinition;
     this.position         = position;
     this.width            = width;
     this.height           = height;
     this.rotation         = 0;
     this.clipping         = false;
     this.brightness       = 50;
     this.contrast         = 50;
     this.fade             = 0;
     this.displayOptions   = ImageDisplayFlags.ShowImage | ImageDisplayFlags.ShowImageWhenNotAlignedWithScreen | ImageDisplayFlags.UseClippingBoundary;
     this.clippingBoundary = new ClippingBoundary(-0.5, -0.5, imageDefinition.Width, imageDefinition.Height);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <c>Image</c> class.
 /// </summary>
 /// <param name="imageDefinition">Image definition.</param>
 /// <param name="position">Image <see cref="Vector3">position</see> in world coordinates.</param>
 public Image(ImageDef imageDefinition, Vector3 position)
     : base(EntityType.Image, DxfObjectCode.Image)
 {
     this.imageDef         = imageDefinition;
     this.position         = position;
     this.width            = imageDefinition.Width * imageDefinition.OnePixelSize.X;
     this.height           = imageDefinition.Height * imageDefinition.OnePixelSize.Y;
     this.rotation         = 0;
     this.clipping         = false;
     this.brightness       = 50.0f;
     this.contrast         = 50.0f;
     this.fade             = 0.0f;
     this.displayOptions   = ImageDisplayFlags.ShowImage | ImageDisplayFlags.ShowImageWhenNotAlignedWithScreen | ImageDisplayFlags.UseClippingBoundary;
     this.clippingBoundary = new ImageClippingBoundary(-0.5, -0.5, imageDefinition.Width, imageDefinition.Height);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <c>Image</c> class.
 /// </summary>
 /// <param name="imageDefinition">Image definition.</param>
 /// <param name="position">Image <see cref="Vector3">position</see> in world coordinates.</param>
 /// <param name="width">Image width in world coordinates.</param>
 /// <param name="height">Image height in world coordinates.</param>
 public Image(ImageDef imageDefinition, Vector3 position, double width, double height)
     : base(EntityType.Image, DxfObjectCode.Image)
 {
     this.imageDef = imageDefinition;
     this.position = position;
     this.width = width;
     this.height = height;
     this.rotation = 0;
     this.clipping = false;
     this.brightness = 50;
     this.contrast = 50;
     this.fade = 0;
     this.displayOptions = ImageDisplayFlags.ShowImage | ImageDisplayFlags.ShowImageWhenNotAlignedWithScreen | ImageDisplayFlags.UseClippingBoundary;
     this.clippingBoundary = new ImageClippingBoundary(-0.5, -0.5, imageDefinition.Width, imageDefinition.Height);
 }