/// <summary> /// Set a picture fill. This tiles the picture. /// </summary> /// <param name="PictureFileName">The file name of the image/picture used.</param> /// <param name="OffsetX"> /// Horizontal offset ranging from -2147483648 pt to 2147483647 pt. However a suggested range is /// -1585pt to 1584pt. Accurate to 1/12700 of a point. /// </param> /// <param name="OffsetY"> /// Vertical offset ranging from -2147483648 pt to 2147483647 pt. However a suggested range is /// -1585pt to 1584pt. Accurate to 1/12700 of a point. /// </param> /// <param name="ScaleX">Horizontal scale in percentage. A suggested range is 0% to 100%.</param> /// <param name="ScaleY">Vertical scale in percentage. A suggested range is 0% to 100%.</param> /// <param name="Alignment">Picture alignment.</param> /// <param name="MirrorType">Picture mirror type.</param> /// <param name="Transparency">Transparency of the picture ranging from 0% to 100%. Accurate to 1/1000 of a percent.</param> public void SetPictureFill(string PictureFileName, decimal OffsetX, decimal OffsetY, decimal ScaleX, decimal ScaleY, A.RectangleAlignmentValues Alignment, A.TileFlipValues MirrorType, decimal Transparency) { Type = SLFillType.BlipFill; BlipTile = true; BlipFileName = PictureFileName; BlipOffsetX = OffsetX; BlipOffsetY = OffsetY; BlipScaleX = ScaleX; BlipScaleY = ScaleY; BlipAlignment = Alignment; BlipMirrorType = MirrorType; BlipTransparency = Transparency; }
/// <summary> /// Set a reflection of the picture. /// </summary> /// <param name="BlurRadius">Blur radius of the reflection, ranging from 0 pt to 2147483647 pt. A suggested range is 0 pt to 100 pt. Accurate to 1/12700 of a point. Default value is 0 pt.</param> /// <param name="StartOpacity">Start opacity of the reflection, ranging from 0% to 100%. Accurate to 1/1000 of a percent. Default value is 100%.</param> /// <param name="StartPosition">Position of start opacity of the reflection, ranging from 0% to 100%. Accurate to 1/1000 of a percent. Default value is 0%.</param> /// <param name="EndAlpha">End alpha of the reflection, ranging from 0% to 100%. Accurate to 1/1000 of a percent. Default value is 0%.</param> /// <param name="EndPosition">Position of end alpha of the reflection, ranging from 0% to 100%. Accurate to 1/1000 of a percent. Default value is 100%.</param> /// <param name="Distance">Distance of the reflection from the origin, ranging from 0 pt to 2147483647 pt. A suggested range is 0 pt to 100 pt. Accurate to 1/12700 of a point. Default value is 0 pt.</param> /// <param name="Direction">Direction of the alpha gradient relative to the origin, ranging from 0 degrees to 359.9 degrees. 0 degrees means to the right, 90 degrees is below, 180 degrees is to the right, and 270 degrees is above. Accurate to 1/60000 of a degree. Default value is 0 degrees.</param> /// <param name="FadeDirection">Direction to fade the reflection, ranging from 0 degrees to 359.9 degrees. 0 degrees means to the right, 90 degrees is below, 180 degrees is to the right, and 270 degrees is above. Accurate to 1/60000 of a degree. Default value is 90 degrees.</param> /// <param name="HorizontalRatio">Horizontal scaling ratio in percentage. A negative ratio flips the reflection horizontally. Accurate to 1/1000 of a percent. Default value is 100%.</param> /// <param name="VerticalRatio">Vertical scaling ratio in percentage. A negative ratio flips the reflection vertically. Accurate to 1/1000 of a percent. Default value is 100%.</param> /// <param name="HorizontalSkew">Horizontal skew angle, ranging from -90 degrees to 90 degrees. Accurate to 1/60000 of a degree. Default value is 0 degrees.</param> /// <param name="VerticalSkew">Vertical skew angle, ranging from -90 degrees to 90 degrees. Accurate to 1/60000 of a degree. Default value is 0 degrees.</param> /// <param name="Alignment">Sets the origin for the size scaling, angle skews and distance offsets. Default value is Bottom.</param> /// <param name="RotateWithShape">True if the reflection should rotate. False otherwise. Default value is true.</param> public void SetReflection(decimal BlurRadius, decimal StartOpacity, decimal StartPosition, decimal EndAlpha, decimal EndPosition, decimal Distance, decimal Direction, decimal FadeDirection, decimal HorizontalRatio, decimal VerticalRatio, decimal HorizontalSkew, decimal VerticalSkew, A.RectangleAlignmentValues Alignment, bool RotateWithShape) { this.BlurRadius = BlurRadius; this.StartOpacity = StartOpacity; this.StartPosition = StartPosition; this.EndAlpha = EndAlpha; this.EndPosition = EndPosition; this.Distance = Distance; this.Direction = Direction; this.FadeDirection = FadeDirection; this.HorizontalRatio = HorizontalRatio; this.VerticalRatio = VerticalRatio; this.HorizontalSkew = HorizontalSkew; this.VerticalSkew = VerticalSkew; this.Alignment = Alignment; this.RotateWithShape = RotateWithShape; }
private void InitialisePicture() { // should be true once we get *everyone* to stop using those confoundedly // hard to understand EMUs and absolute positionings... UseEasyPositioning = false; TopPosition = 0; LeftPosition = 0; UseRelativePositioning = true; AnchorRowIndex = 1; AnchorColumnIndex = 1; OffsetX = 0; OffsetY = 0; WidthInEMU = 0; HeightInEMU = 0; WidthInPixels = 0; HeightInPixels = 0; fHorizontalResolutionRatio = 1; fVerticalResolutionRatio = 1; this.bLockWithSheet = true; this.bPrintWithSheet = true; this.vCompressionState = A.BlipCompressionValues.Print; this.decBrightness = 0; this.decContrast = 0; //this.decRotationAngle = 0; this.vPictureShape = A.ShapeTypeValues.Rectangle; this.FillType = SLPictureFillType.None; this.FillClassInnerXml = string.Empty; this.HasOutline = false; this.PictureOutline = new A.Outline(); this.HasOutlineFill = false; this.PictureOutlineFill = new A.SolidFill(); this.HasGlow = false; this.GlowRadius = 0; this.GlowColorInnerXml = string.Empty; this.HasInnerShadow = false; this.PictureInnerShadow = new A.InnerShadow(); this.HasOuterShadow = false; this.PictureOuterShadow = new A.OuterShadow(); this.HasReflection = false; this.ReflectionBlurRadius = 0; this.ReflectionStartOpacity = 100000; this.ReflectionStartPosition = 0; this.ReflectionEndAlpha = 0; this.ReflectionEndPosition = 100000; this.ReflectionDistance = 0; this.ReflectionDirection = 0; this.ReflectionFadeDirection = 5400000; this.ReflectionHorizontalRatio = 100000; this.ReflectionVerticalRatio = 100000; this.ReflectionHorizontalSkew = 0; this.ReflectionVerticalSkew = 0; this.ReflectionAlignment = A.RectangleAlignmentValues.Bottom; this.ReflectionRotateWithShape = true; this.HasSoftEdge = false; this.SoftEdgeRadius = 0; this.HasScene3D = false; this.CameraLatitude = 0; this.CameraLongitude = 0; this.CameraRevolution = 0; this.CameraPreset = A.PresetCameraValues.OrthographicFront; this.CameraFieldOfView = 0; this.CameraZoom = 0; this.LightRigLatitude = 0; this.LightRigLongitude = 0; this.LightRigRevolution = 0; this.LightRigType = A.LightRigValues.ThreePoints; this.LightRigDirection = A.LightRigDirectionValues.Top; //this.HasBackdrop = false; //this.BackdropAnchorX = 0; //this.BackdropAnchorY = 0; //this.BackdropAnchorZ = 0; //this.BackdropNormalDx = 0; //this.BackdropNormalDy = 0; //this.BackdropNormalDz = 0; //this.BackdropUpVectorDx = 0; //this.BackdropUpVectorDy = 0; //this.BackdropUpVectorDz = 0; this.HasBevelTop = false; this.BevelTopPreset = A.BevelPresetValues.Circle; this.BevelTopWidth = 76200; this.BevelTopHeight = 76200; this.HasBevelBottom = false; this.BevelBottomPreset = A.BevelPresetValues.Circle; this.BevelBottomWidth = 76200; this.BevelBottomHeight = 76200; this.HasExtrusion = false; this.ExtrusionHeight = 0; this.ExtrusionColorInnerXml = string.Empty; this.HasContour = false; this.ContourWidth = 0; this.ContourColorInnerXml = string.Empty; this.HasMaterialType = false; this.MaterialType = A.PresetMaterialTypeValues.WarmMatte; this.HasZDistance = false; this.ZDistance = 0; this.HasUri = false; this.HyperlinkUri = string.Empty; this.HyperlinkUriKind = UriKind.Absolute; this.IsHyperlinkExternal = true; this.DataIsInFile = true; this.PictureFileName = string.Empty; this.PictureByteData = new byte[1]; this.PictureImagePartType = ImagePartType.Bmp; }
/// <summary> /// Set a reflection of the picture. /// </summary> /// <param name="BlurRadius">Blur radius of the reflection, ranging from 0 pt to 2147483647 pt (but consider a much lower maximum). Accurate to 1/12700 of a point. Default value is 0 pt.</param> /// <param name="StartOpacity">Start opacity of the reflection, ranging from 0% to 100%. Accurate to 1/1000 of a percent. Default value is 100%.</param> /// <param name="StartPosition">Position of start opacity of the reflection, ranging from 0% to 100%. Accurate to 1/1000 of a percent. Default value is 0%.</param> /// <param name="EndAlpha">End alpha of the reflection, ranging from 0% to 100%. Accurate to 1/1000 of a percent. Default value is 0%.</param> /// <param name="EndPosition">Position of end alpha of the reflection, ranging from 0% to 100%. Accurate to 1/1000 of a percent. Default value is 100%.</param> /// <param name="Distance">Distance of the reflection from the picture, ranging from 0 pt to 2147483647 pt (but consider a much lower maximum). Accurate to 1/12700 of a point. Default value is 0 pt.</param> /// <param name="Direction">Direction of the alpha gradient relative to the picture, ranging from 0 degrees to 359.9 degrees. 0 degrees means to the right, 90 degrees is below, 180 degrees is to the right, and 270 degrees is above. Accurate to 1/60000 of a degree. Default value is 0 degrees.</param> /// <param name="FadeDirection">Direction to fade the reflection, ranging from 0 degrees to 359.9 degrees. 0 degrees means to the right, 90 degrees is below, 180 degrees is to the right, and 270 degrees is above. Accurate to 1/60000 of a degree. Default value is 90 degrees.</param> /// <param name="HorizontalRatio">Horizontal scaling ratio in percentage. A negative ratio flips the reflection horizontally. Accurate to 1/1000 of a percent. Default value is 100%.</param> /// <param name="VerticalRatio">Vertical scaling ratio in percentage. A negative ratio flips the reflection vertically. Accurate to 1/1000 of a percent. Default value is 100%.</param> /// <param name="HorizontalSkew">Horizontal skew angle, ranging from -90 degrees to 90 degrees. Accurate to 1/60000 of a degree. Default value is 0 degrees.</param> /// <param name="VerticalSkew">Vertical skew angle, ranging from -90 degrees to 90 degrees. Accurate to 1/60000 of a degree. Default value is 0 degrees.</param> /// <param name="Alignment">Sets the origin of the picture for the size scaling, angle skews and distance offsets. Default value is Bottom.</param> /// <param name="RotateWithShape">True if the reflection should rotate with the picture if the picture is rotated. False otherwise. Default value is true.</param> public void SetReflection(decimal BlurRadius, decimal StartOpacity, decimal StartPosition, decimal EndAlpha, decimal EndPosition, decimal Distance, decimal Direction, decimal FadeDirection, decimal HorizontalRatio, decimal VerticalRatio, decimal HorizontalSkew, decimal VerticalSkew, A.RectangleAlignmentValues Alignment, bool RotateWithShape) { this.HasReflection = true; this.ReflectionBlurRadius = SLDrawingTool.CalculatePositiveCoordinate(BlurRadius); this.ReflectionStartOpacity = SLDrawingTool.CalculatePositiveFixedPercentage(StartOpacity); this.ReflectionStartPosition = SLDrawingTool.CalculatePositiveFixedPercentage(StartPosition); this.ReflectionEndAlpha = SLDrawingTool.CalculatePositiveFixedPercentage(EndAlpha); this.ReflectionEndPosition = SLDrawingTool.CalculatePositiveFixedPercentage(EndPosition); this.ReflectionDistance = SLDrawingTool.CalculatePositiveCoordinate(Distance); this.ReflectionDirection = SLDrawingTool.CalculatePositiveFixedAngle(Direction); this.ReflectionFadeDirection = SLDrawingTool.CalculatePositiveFixedAngle(FadeDirection); this.ReflectionHorizontalRatio = SLDrawingTool.CalculatePercentage(HorizontalRatio); this.ReflectionVerticalRatio = SLDrawingTool.CalculatePercentage(VerticalRatio); this.ReflectionHorizontalSkew = SLDrawingTool.CalculateFixedAngle(HorizontalSkew); this.ReflectionVerticalSkew = SLDrawingTool.CalculateFixedAngle(VerticalSkew); this.ReflectionAlignment = Alignment; this.ReflectionRotateWithShape = RotateWithShape; }