Flipping an Image

 

You can flip a DIB or Bitmap stored in memory, either horizontally or vertically. Use the FlipBitmapVertical, FlipBitmapHorizontal, FlipDIBVertical and FlipDIBHorizontal functions/methods from BiDIB DLL or OCX.

 

[C++]

 

/* Flipping an image horizontally*/

 

#include “BiDIB.h”

 

HDIB hDibNew;

 

/* 1. parameter: Handle of the DIB to flip */

 

hDibNew = FlipDIBHorizontal(hDib);

 

if (!hDibNew)

{

            // Error

}

 

[VB]

 

‘ Flipping an image horizontally

 

Dim BiDIBobj as Object

Dim hDibNew as Long

 

Set BiDIBobj = CreateObject("BIDIB.BIDIBCtrl.1")

 

‘ 1. parameter: Handle of the DIB to flip

 

hDibNew = BiDIBobj.FlipDIBHorizontal(hDib)

 

Set BIDIBObj = Nothing

 

If hDibNew = 0 Then

            ‘ Error

End If

 

[C#]

 

/* Flipping an image horizontally*/

 

int hDibNew;

 

/* 1. parameter: Handle of the DIB to flip */

 

hDibNew = BiDIB.FlipDIBHorizontal(hDib);

 

if (hDibNew == 0)

{

            // Error

}