ImageGear for C and C++ on Linux v20.0 - Updated
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Image Processing Functions > IG_IP_flip

Flips the image referenced by hIGear either horizontally or vertically.


Copy Code
   HIGEAR hIGear,
   AT_MODE nDirection


Name Type Description
hIGear HIGEAR HIGEAR handle of image to flip.
nDirection AT_MODE IG_FLIP_HORIZONTAL or IG_FLIP_VERTICAL, indicating whether to flip horizontally or vertically.

Return Value:

Returns 0 if successful. Otherwise, returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.


Copy Code
HIGEAR hIGear;            // HIGEAR handle of the image
AT_ERRCOUNT nErrcount;    // Count of errs on stack upon ret from func

// Load image file "picture.bmp" from working directory
nErrcount = IG_load_file("picture.bmp", &hIGear);
if(nErrcount == 0)
    nErrcount = IG_IP_flip(hIGear, IG_FLIP_VERTICAL);
    // ...
    // Destroy the image


Flipping horizontally exchanges the right-most pixel column of the image bitmap with the left-most. Flipping vertically exchanges the topmost pixel row (raster) of the image bitmap with the bottom-most. The dimensions of the image do not change.

If you want to turn the image upside-down (not the same as a vertical flip), use function IG_IP_rotate_multiple_90, with rotation mode set to IG_ROTATE_180.

Is this page helpful?
Yes No
Thanks for your feedback.