Reference Guide
GdPicture14 Namespace / GdPictureImaging Class / FxNegative Method
GdPicture image identifier.
Example





In This Topic
    FxNegative Method (GdPictureImaging)
    In This Topic
    Performs a negative effect (color inversion) on a GdPicture image or on an area of a GdPicture image defined by SetROI() method.
    Syntax
    'Declaration
     
    
    Public Function FxNegative( _
       ByVal ImageID As Integer _
    ) As GdPictureStatus
    public GdPictureStatus FxNegative( 
       int ImageID
    )
    public function FxNegative( 
        ImageID: Integer
    ): GdPictureStatus; 
    public function FxNegative( 
       ImageID : int
    ) : GdPictureStatus;
    public: GdPictureStatus FxNegative( 
       int ImageID
    ) 
    public:
    GdPictureStatus FxNegative( 
       int ImageID
    ) 

    Parameters

    ImageID
    GdPicture image identifier.

    Return Value

    A member of the GdPictureStatus enumeration.
    Remarks
    This method is used in the "Image Processing" Demo.
    Example
    Performing a negative effect on a GdPicture image.
    Applying a negative effect on a single jpeg image.
    using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
    {
        // LoadInMemory parameter is set to true in order to be able to update the input file.
        int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg", true);
        gdpictureImaging.FxNegative(imageID);
        gdpictureImaging.SaveAsJPEG(imageID, "image.jpg", 75);
        gdpictureImaging.ReleaseGdPictureImage(imageID);
    }
    Applying the fire effect and negative effect to two duplicates of the same image.
    using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
    {
        // Create two duplicate gdpicture images from the input file.
        int imageID1 = gdpictureImaging.CreateGdPictureImageFromFile("image.jpg", false);
        int imageID2 = gdpictureImaging.CreateClonedGdPictureImage(imageID1);
     
        // Process both of your images (differently).
        gdpictureImaging.FxFire(imageID1);
        gdpictureImaging.FxNegative(imageID2);
     
        // Save your images in the same multipage tif file.
        gdpictureImaging.TiffSaveAsMultiPageFile(imageID1, "images.tif", TiffCompression.TiffCompressionAUTO);
        gdpictureImaging.TiffAddToMultiPageFile(imageID1, imageID2);
        gdpictureImaging.TiffCloseMultiPageFile(imageID1);
        gdpictureImaging.ReleaseGdPictureImage(imageID1);
        gdpictureImaging.ReleaseGdPictureImage(imageID2);
    }
    See Also