Scaling an Image

 

Use the ScaleDIB function or method from BiDIB DLL or OCX for resizing an image. There is a bilinear and a cubic spline method for scaling.

 

[C++]

 

/* Scaling an image */

 

#include “BiDIB.h”

 

HDIB hDibNew;

XYSIZE  xySize;

 

xySize.x = 100;

xySize.y = 100;

 

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

   2. parameter: Method (0 – bilinear 1 – cubic spline

   3. parameter: Size of the output DIB */

 

hDibNew = ScaleDIB(hDib, 0, xySize);

 

if (!hDibNew)

{

            // Error

}

 

[VB]

 

‘ Scaling an image

 

Dim BiDIBobj as Object

Dim hDibNew as Long

 

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

 

‘ 1. parameter: Handle of the DIB to scale

‘ 2. parameter: Method (0 – bilinear 1 – cubic spline

‘ 3. parameter: X size of the output DIB

‘ 4. paramter: Y size of the output DIB

 

hDibNew = BiDIBobj.ScaleDIB(hDib, 0, 100, 100)

 

Set BIDIBObj = Nothing

 

If hDibNew = 0 Then

            ‘ Error

End If

 

[C#]

 

/* Scaling an image */

 

int hDibNew;

 

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

   2. parameter: Method (0 – bilinear 1 – cubic spline

   3. parameter: Size of the output DIB */

 

hDibNew = BiDIB.ScaleDIB(hDib, 0, 100, 100);

 

if (hDibNew == 0)

{

            // Error

}