←Select platform

Draw3dShape(IntPtr,SpecialEffectsShape,Rectangle,Color,IntPtr,Rectangle,SpecialEffectsBackStyle,Color,SpecialEffectsFillStyle,Color,SpecialEffectsBorderStyle,int,Color,Color,SpecialEffectsInnerStyle,int,Color,Color,SpecialEffectsOuterStyle,int,int,int,Color,IntPtr) Method

Summary
Draws the specified three-dimensional shape onto the target device context using the specified color, style, and size.

Syntax
C#
C++/CLI
Python
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 
)  

Parameters

hdc
Handle to the target device context.

shape
Shape type. For valid values, refer to SpecialEffectsShape.

destRect
Rectangle to be used as the display destination rectangle.

backColor
Value that specifies the background color.

backImageHdc
Handle to the source device context for background. Use this parameter and prcBack to place an image from another device context onto the background of the shape. To use a background image, the fillStyle parameter must not be Solid.

backRect
Rectangle to be used as the display background rectangle.

backStyle
Background style. For valid values, refer to SpecialEffectsBackStyle.

fillColor
Value that specifies the foreground color.

fillStyle
Foreground style. For valid values, refer to  fillStyle.

borderColor
Value that specifies the border color.

borderStyle
Border style. For valid values, refer to SpecialEffectsBorderStyle.

borderWidth
Border width.

innerHiliteColor
Value that specifies the inner band highlight color.

innerShadowColor
Value that specifies the inner band shadow color.

innerStyle
Inner band style. For valid values, refer to SpecialEffectsInnerStyle. The inner band is available only for squares and rectangles.

innerWidth
Inner band width.

outerHiliteColor
Value that specifies the outer band highlight color.

outerShadowColor
Value that specifies the inner band shadow color.

outerStyle
Outer band style. For valid values, refer to SpecialEffectsOuterStyle.

outerWidth
Outer band width.

shadowX
Horizontal position of the shadow.

shadowY
Vertical position of the shadow.

shadowColor
Value that specifies the shadow color.

shapeHrgn
Handle to a Windows region that defines the shape. This parameter is used only if the shape parameter is Region.

Remarks

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.

Example

This example shows the minimum requirements for using the Draw3dShape(Graphics,SpecialEffectsShape,Rectangle,Color,Image,Rectangle,SpecialEffectsBackStyle,Color,SpecialEffectsFillStyle,Color,SpecialEffectsBorderStyle,Int32,Color,Color,SpecialEffectsInnerStyle,Int32,Color,Color,SpecialEffectsOuterStyle,Int32,Int32,Int32,Color,Region) method.

C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.SpecialEffects; 
using Leadtools.Drawing; 
 
 
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:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.3.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.SpecialEffects Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.