FxNegative Method (GdPictureImaging)
Performs a negative effect (color inversion) on a GdPicture image or on an area of a GdPicture image
defined by SetROI() method.
'Declaration
Public Function FxNegative( _
ByVal As Integer _
) As GdPictureStatus
Parameters
- ImageID
- GdPicture image identifier.
Return Value
A member of the GdPictureStatus enumeration.
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);
}