Leadtools.SpecialEffects Namespace > SpecialEffectsProcessor Class > Draw3dShape Method : Draw3dShape(IntPtr,SpecialEffectsShape,Rectangle,Color,IntPtr,Rectangle,SpecialEffectsBackStyle,Color,SpecialEffectsFillStyle,Color,SpecialEffectsBorderStyle,Int32,Color,Color,SpecialEffectsInnerStyle,Int32,Color,Color,SpecialEffectsOuterStyle,Int32,Int32,Int32,Color,IntPtr) Method |
public void Draw3dShape( IntPtr hdc, SpecialEffectsShape shape, Rectangle destRect, Color backColor, IntPtr backImageHdc, Rectangle backRect, SpecialEffectsBackStyle backStyle, Color fillColor, SpecialEffectsFillStyle fillStyle, Color borderColor, SpecialEffectsBorderStyle borderStyle, int borderWidth, Color innerHiliteColor, Color innerShadowColor, SpecialEffectsInnerStyle innerStyle, int innerWidth, Color outerHiliteColor, Color outerShadowColor, SpecialEffectsOuterStyle outerStyle, int outerWidth, int shadowX, int shadowY, Color shadowColor, IntPtr shapeHrgn )
'Declaration Public Overloads Sub Draw3dShape( _ ByVal hdc As IntPtr, _ ByVal shape As SpecialEffectsShape, _ ByVal destRect As Rectangle, _ ByVal backColor As Color, _ ByVal backImageHdc As IntPtr, _ ByVal backRect As Rectangle, _ ByVal backStyle As SpecialEffectsBackStyle, _ ByVal fillColor As Color, _ ByVal fillStyle As SpecialEffectsFillStyle, _ ByVal borderColor As Color, _ ByVal borderStyle As SpecialEffectsBorderStyle, _ ByVal borderWidth As Integer, _ ByVal innerHiliteColor As Color, _ ByVal innerShadowColor As Color, _ ByVal innerStyle As SpecialEffectsInnerStyle, _ ByVal innerWidth As Integer, _ ByVal outerHiliteColor As Color, _ ByVal outerShadowColor As Color, _ ByVal outerStyle As SpecialEffectsOuterStyle, _ ByVal outerWidth As Integer, _ ByVal shadowX As Integer, _ ByVal shadowY As Integer, _ ByVal shadowColor As Color, _ ByVal shapeHrgn As IntPtr _ )
'Usage Dim instance As SpecialEffectsProcessor Dim hdc As IntPtr Dim shape As SpecialEffectsShape Dim destRect As Rectangle Dim backColor As Color Dim backImageHdc As IntPtr Dim backRect As Rectangle Dim backStyle As SpecialEffectsBackStyle Dim fillColor As Color Dim fillStyle As SpecialEffectsFillStyle Dim borderColor As Color Dim borderStyle As SpecialEffectsBorderStyle Dim borderWidth As Integer Dim innerHiliteColor As Color Dim innerShadowColor As Color Dim innerStyle As SpecialEffectsInnerStyle Dim innerWidth As Integer Dim outerHiliteColor As Color Dim outerShadowColor As Color Dim outerStyle As SpecialEffectsOuterStyle Dim outerWidth As Integer Dim shadowX As Integer Dim shadowY As Integer Dim shadowColor As Color Dim shapeHrgn As IntPtr instance.Draw3dShape(hdc, shape, destRect, backColor, backImageHdc, backRect, backStyle, fillColor, fillStyle, borderColor, borderStyle, borderWidth, innerHiliteColor, innerShadowColor, innerStyle, innerWidth, outerHiliteColor, outerShadowColor, outerStyle, outerWidth, shadowX, shadowY, shadowColor, shapeHrgn)
public void Draw3dShape( IntPtr hdc, SpecialEffectsShape shape, Rectangle destRect, Color backColor, IntPtr backImageHdc, Rectangle backRect, SpecialEffectsBackStyle backStyle, Color fillColor, SpecialEffectsFillStyle fillStyle, Color borderColor, SpecialEffectsBorderStyle borderStyle, int borderWidth, Color innerHiliteColor, Color innerShadowColor, SpecialEffectsInnerStyle innerStyle, int innerWidth, Color outerHiliteColor, Color outerShadowColor, SpecialEffectsOuterStyle outerStyle, int outerWidth, int shadowX, int shadowY, Color shadowColor, IntPtr shapeHrgn )
function Leadtools.SpecialEffects.SpecialEffectsProcessor.Draw3dShape(IntPtr,SpecialEffectsShape,Rectangle,Color,IntPtr,Rectangle,SpecialEffectsBackStyle,Color,SpecialEffectsFillStyle,Color,SpecialEffectsBorderStyle,Int32,Color,Color,SpecialEffectsInnerStyle,Int32,Color,Color,SpecialEffectsOuterStyle,Int32,Int32,Int32,Color,IntPtr)( hdc , shape , destRect , backColor , backImageHdc , backRect , backStyle , fillColor , fillStyle , borderColor , borderStyle , borderWidth , innerHiliteColor , innerShadowColor , innerStyle , innerWidth , outerHiliteColor , outerShadowColor , outerStyle , outerWidth , shadowX , shadowY , shadowColor , shapeHrgn )
public: void Draw3dShape( IntPtr hdc, SpecialEffectsShape shape, Rectangle destRect, Color backColor, IntPtr backImageHdc, Rectangle backRect, SpecialEffectsBackStyle backStyle, Color fillColor, SpecialEffectsFillStyle fillStyle, Color borderColor, SpecialEffectsBorderStyle borderStyle, int borderWidth, Color innerHiliteColor, Color innerShadowColor, SpecialEffectsInnerStyle innerStyle, int innerWidth, Color outerHiliteColor, Color outerShadowColor, SpecialEffectsOuterStyle outerStyle, int outerWidth, int shadowX, int shadowY, Color shadowColor, IntPtr shapeHrgn )
Use backImage and backRect to place an image from another device context onto the background of the shape.
For general information, refer to Implementing Special Effects.
Public Sub Draw3dShape(ByVal g As Graphics, ByVal destRect As Rectangle) Dim processor As SpecialEffectsProcessor = New SpecialEffectsProcessor() Dim img As Image = Image.FromFile(Path.Combine(LEAD_VARS.ImagesDir, "Ulay1.bmp")) Dim imageRect As Rectangle = New Rectangle(0, 0, img.Width, img.Height) processor.Draw3dShape(g, SpecialEffectsShape.Star4, destRect, Color.Blue, img, imageRect, SpecialEffectsBackStyle.TranslucentTiledImage, Color.Red, _ SpecialEffectsFillStyle.Transparent, Color.Red, SpecialEffectsBorderStyle.Solid, 5, Color.White, Color.Gray, _ SpecialEffectsInnerStyle.Inset, 3, Color.Red, Color.Gray, SpecialEffectsOuterStyle.Inset, 3, 2, 2, Color.Black, _ Nothing) ' no region handle img.Dispose() End Sub Public NotInheritable Class LEAD_VARS Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" End Class
public void Draw3dShape(Graphics g, Rectangle destRect) { SpecialEffectsProcessor processor = new SpecialEffectsProcessor(); Image image = Image.FromFile(Path.Combine(LEAD_VARS.ImagesDir, "Ulay1.bmp")); Rectangle imageRect = new Rectangle(0, 0, image.Width, image.Height); processor.Draw3dShape(g, SpecialEffectsShape.Star4, /* star shape */ destRect, /* destination rectangle */ Color.Blue, /* background color, blue */ image, /* use this to place an image in the background */ imageRect, /* display background rectangle */ SpecialEffectsBackStyle.TranslucentTiledImage, /* style flags for 3D shape */ Color.Red, /* foreground color, red */ SpecialEffectsFillStyle.Transparent, /* foreground style */ Color.Red, /* border color, red */ SpecialEffectsBorderStyle.Solid, /* border style */ 5, /* border width */ Color.White, /* inner band highlight color, white */ Color.Gray, /* inner band shadow color */ SpecialEffectsInnerStyle.Inset, /* inner band style */ 3, /* inner band width */ Color.Red, /* outer band highlight color, RED */ Color.Gray, /* outer band shadow color */ SpecialEffectsOuterStyle.Inset,/* outer band style */ 3, /* outer band width */ 2, /* horizontal shadow position */ 2, /* vertical shadow position */ Color.Black, /* shadow color, black */ null); /* no region handle */ image.Dispose(); } static class LEAD_VARS { public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2