Array of
Color structures that specifies an array of colors that will be mixed with the original gray values.
Syntax
Visual Basic (Declaration) | |
---|
Public Property NewColor As Color() |
C# | |
---|
public Color[] NewColor {get; set;} |
Managed Extensions for C++ | |
---|
public: __property Color[]* get_NewColor();
public: __property void set_NewColor(
Color[]* value
); |
C++/CLI | |
---|
public:
property array<Color>^ NewColor {
array<Color>^ get();
void set (Colorarray<value>^ value);
} |
XAML | |
---|
cannot be used in XAML directly.Instead use x:Array Markup Extension. |
XAML Attributes Usage | |
---|
<object Color =Color > |
Dependency Property Information | |
---|
Identifier field | NewColorProperty |
Metadata properties set to true | None |
Return Value
Array of
Color structures that specifies an array of colors that will be mixed with the original gray values. If this parameter is set to null, the Color property must contain a valid color. Pass null when you want the command to create the array of colors, two colors when replacing both colors in a binary image, or 256 colors when using a custom array of colors.
Example
Run the GrayScaleToDuotoneCommandBitmapEffect on an image.
Visual Basic | Copy Code |
---|
Public Sub NewColorPropertyExample(ByVal element As FrameworkElement)
Dim effect As GrayScaleToDuotoneCommandBitmapEffect = New GrayScaleToDuotoneCommandBitmapEffect()
Dim array() As Color
Dim i As Integer
ReDim array(255)
For i = 0 To 255
array(i) = Color.FromRgb(255, CType(i \ 4, Byte), CType(i, Byte))
Next
effect.Type = GrayScaleToDuotoneCommandBitmapEffectsMixingType.ReplaceOldWithNew
effect.NewColor = array
element.BitmapEffect = effect
End Sub
|
C# | Copy Code |
---|
//Run the GrayScaleToDuotone command on an image public void NewColorPropertyExample(FrameworkElement element) { GrayScaleToDuotoneCommandBitmapEffect effect = new GrayScaleToDuotoneCommandBitmapEffect(); // Prepare the command System.Windows.Media.Color[] array = new System.Windows.Media.Color[256]; for (int i = 0; i < 256; i++) array[i] = System.Windows.Media.Color.FromRgb(255, (byte)(i / 4), (byte)(i)); effect.NewColor = array; effect.Type = GrayScaleToDuotoneCommandBitmapEffectsMixingType.ReplaceOldWithNew; element.BitmapEffect = effect; } |
Requirements
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Vista, and Windows Server 2003
See Also