Main site Help Coding Download Language(EN)
Welcome on CANI.COM.PL



Structure list

typedef struct tagCANI_BGRAQUAD {
CANI_BYTE Blue;
CANI_BYTE Green;
CANI_BYTE Red;
CANI_BYTE Alpha;
} CANI_BGRAQUAD;

typedef struct tagCANI_RGBAQUAD {
CANI_BYTE Red;
CANI_BYTE Green;
CANI_BYTE Blue;
CANI_BYTE Alpha;
} CANI_RGBAQUAD;

List of ENUM enumeration types

enum CANI_RESIZE_METHOD
{
CANI_FAST_RESIZE,
CANI_INTERPOLATION,
CANI_SQUARE_INTERPOLATION,
CANI_CUBIC_INTERPOLATION,
CANI_LAGRANGE_INTERPOLATION
};

Function list

CANI_LONG CANI_CalculateNextFrame( CANI_ANIMATION* animation, CANI_DWORD* AddTime );
Calculate next frame for given time
animation
Pointer to the animation
AddTime [ms]
The elapsed time since the last use of this function
return value
Current frame number.
If an error occurs, the return value is -1


void CANI_ConvertBackgroundColorToAlpha( CANI_ANIMATION* animation );
Create alpha channel values based on the background color
animation
Pointer to the animation


CANI_ANIMATION* CANI_CreateResizedAnimation( CANI_ANIMATION* animation, CANI_LONG dest_cx, CANI_LONG dest_cy, CANI_RESIZE_METHOD method );
Create resized animation
animation
Pointer to the animation
dest_cx
Target width
dest_cy
Target height
method
Resize method
return value
Resized animation


void CANI_FreeAnimation( CANI_ANIMATION* animation );
Free animation from memory
animation
Pointer to the animation


CANI_LONG CANI_GetCurrentFrame( CANI_ANIMATION* animation );
Get the current frame number
animation
Pointer to the animation
return value
Current frame number.
If an error occurs, the return value is -1


CANI_CHAR CANI_GetFrameBackgroundColor( CANI_ANIMATION* animation, CANI_DWORD FrameNR, CANI_RGBAQUAD* bgColorRGB );
Get frame background color
animation
Pointer to the animation
FrameNR
Frame number
bgColorRGB
Pointer to background color
return value
TRUE - the background color is saved in the bgColorRGB variable and the transparency for the given frame is set.
FALSE - the background color is saved in the bgColorRGB variable and the transparency for the given frame is not set.
If an error occurs, the return value is -1


CANI_LONG CANI_GetFrameDisplayTime( CANI_ANIMATION* animation, CANI_DWORD FrameNR );
Get frame display time
animation
Pointer to the animation
FrameNR
Frame number
return value
Frame display time [ms].
If an error occurs, the return value is -1


CANI_CHAR CANI_GetImageOfCurrentFrame( CANI_ANIMATION* animation, CANI_BGRAQUAD* ImageData );
Get image of current frame
animation
Pointer to the animation
ImageData
Pointer to the 32 bit BGR color data
return value
If function succeeds return value is TRUE


CANI_CHAR CANI_GetImageOfCurrentFrameRGBA( CANI_ANIMATION* animation, CANI_RGBAQUAD* ImageData );
Get image of current frame
animation
Pointer to the animation
ImageData
Pointer to the 32 bit RGB color data
return value
If function succeeds return value is TRUE


CANI_CHAR CANI_GetImageOfFrame( CANI_ANIMATION* animation, CANI_DWORD FrameNR, CANI_BGRAQUAD* ImageData );
Get image of a frame
animation
Pointer to the animation
FrameNR
Frame number
ImageData
Pointer to the 32 bit BGR color data
return value
If function succeeds return value is TRUE


CANI_CHAR CANI_GetImageOfFrameRGBA( CANI_ANIMATION* animation, CANI_DWORD FrameNR, CANI_RGBAQUAD* ImageData );
Get image of a frame
animation
Pointer to the animation
FrameNR
Frame number
ImageData
Pointer to the 32 bit RGB color data
return value
If function succeeds return value is TRUE


CANI_DWORD CANI_GetImageSize( CANI_ANIMATION* animation, CANI_DWORD* Width, CANI_DWORD* Height );
Get image Width, Height and size in pixels
animation
Pointer to the animation
Width
Pointer to the Width address
Height
Pointer to the Height address
return value
Size in pixels² of this animation ( Width * Height )


CANI_LONG CANI_GetNumberOfFrames( CANI_ANIMATION* animation );
Get number of frames
animation
Pointer to the animation
return value
Number of frames.
If an error occurs, the return value is -1


void CANI_InitDraw( );
Initialize data for drawing


CANI_LONG CANI_NextFrame( CANI_ANIMATION* animation );
Get the next frame number
animation
Pointer to the animation
return value
Current frame number.
If an error occurs, the return value is -1


CANI_ANIMATION* CANI_OpenAnimationA( CANI_CHAR* FileName );
Open and read animation
FileName
Pointer to the file name (ASCII)
return value
Animation


CANI_ANIMATION* CANI_OpenAnimationW( CANI_WORD* FileName );
Open and read animation
FileName
Pointer to the file name (UTF-16)
return value
Animation


CANI_ANIMATION* CANI_ReadAnimation( FILE* File );
Read animation
File
Pointer to the file data
return value
Animation


CANI_CHAR CANI_WinDrawImage( CANI_ANIMATION* animation, HDC dest, CANI_LONG x, CANI_LONG y );
Draw current image
animation
Pointer to the animation
dest
Handle of device context
x
Target position x
y
Target position y
return value
If function succeeds return value is TRUE


CANI_CHAR CANI_WinDrawMask( CANI_ANIMATION* animation, HDC dest, CANI_LONG x, CANI_LONG y );
Draw current mask
animation
Pointer to the animation
dest
Handle of device context
x
Target position x
y
Target position y
return value
If function succeeds return value is TRUE