You are here: GdPicture.NET > Documentation > Classes > GdPictureImaging Class > GdPictureImaging Methods > Color Manipulation > SwapColor > SwapColor Method (Integer, Color, Color, Single)
logo.gif
ContentsIndexHome
PreviousUpNext
GdPictureImaging.SwapColor Method (Integer, Color, Color, Single)

Replaces one color by another on a GdPicture image or into an area of a GdPicture image defined by SetROI() function. 

This function takes a percentage threshold parameter regarding the color to replace. 

Ie: A threshold value of 90 means that all the color which are near than 90% of the color to replace will be considered.

C#
public GdPictureStatus SwapColor(
    int ImageID, 
    Color ColorSrc, 
    Color ColorDst, 
    Single Threshold
);
Visual Basic
Public Function SwapColor(
    ByVal ImageID As Integer, 
    ByVal ColorSrc As Color, 
    ByVal ColorDst As Color, 
    ByVal Threshold As Single
) As GdPictureStatus
Parameters
Parameters 
Description 
ImageID 
GdPicture Image Identifier.  
ColorSrc 
A Color Object. You can build a Color Object using the ARGB() function. Color to replace.  
ColorDst 
A Color Object. You can build a Color Object using the ARGB() function. Color of replacement.  
Threshold 
percentage threshold between 0 and 100.  
Returns

A member of the GdPictureStatus enumeration.

What do you think about this topic? Send feedback!
Copyright (c) 2009-2011 www.gdpicture.com. All rights reserved.