Amigos
En un ejemplo que colocó Antonio indicaba que para hacer que funcionara un GIF animado se ejecutaba una función llamada CreateGIF(). Alguién tiene ese código para compartir?
Gracias por adelantado.
Armando
Armando Picon wrote:Amigos
En un ejemplo que colocó Antonio indicaba que para hacer que funcionara un GIF animado se ejecutaba una función llamada CreateGIF(). Alguién tiene ese código para compartir?
Gracias por adelantado.
Armando
xLINK: error: Unresolved external symbol '_HB_FUN_CREATEGIF'.
xLINK: error: Unresolved external symbol '_HB_FUN_GIFHWND'.
xLINK: fatal error: 2 unresolved external(s).
Antonio Linares wrote:Armando,
Este es el código que usamos como punto de partida:
https://xbmc.svn.sourceforge.net/svnroo ... tedGif.cpp
class C_Image {
public:
// standard members:
int Width, Height; // Dimensions in pixels
int BPP; // Bits Per Pixel
char * Raster; // Bits of Raster Data (Byte Aligned)
COLOR * Palette; // Color Map
int BytesPerRow; // Width (in bytes) including alignment!
int Transparent; // Index of Transparent color (-1 for none)
// Extra members for animations:
int xPos, yPos; // Relative Position
int Delay; // Delay after image in 1/1000 seconds.
int Transparency; // Animation Transparency.
// Windows GDI specific:
BITMAPINFO * pbmi; // BITMAPINFO structure
// constructor and destructor:
C_Image() { Raster=0; Palette=0; pbmi=0; }
~C_Image() { delete[]pbmi; delete[]Raster; }
// operator= (object copy)
C_Image& operator= (C_Image& rhs);
// Image initializer (allocates space for raster and palette):
void Init (int iWidth, int iHeight, int iBPP);
inline char& Pixel (const int& x, const int& y)
{return Raster[y*BytesPerRow+x];}
// Windows GDI Specific function to paint the image on a DC:
int GDIPaint (HDC hdc, int xDest, int yDest);
// File Formats:
int LoadBMP (char* szFile);
int SaveBMP (char* szFile);
};
typedef struct
{
int Width, Height; // Dimensions in pixels
int BPP; // Bits Per Pixel
char * Raster; // Bits of Raster Data (Byte Aligned)
COLOR * Palette; // Color Map
int BytesPerRow; // Width (in bytes) including alignment!
int Transparent; // Index of Transparent color (-1 for none)
// Extra members for animations:
int xPos, yPos; // Relative Position
int Delay; // Delay after image in 1/1000 seconds.
int Transparency; // Animation Transparency.
// Windows GDI specific:
BITMAPINFO * pbmi; // BITMAPINFO structure
} CIMAGE, * PCIMAGE;
PCIMAGE CImageNew( void )
{
PCIMAGE pCImage = ( PCIMAGE ) hb_xgrab( sizeof( CIMAGE ) );
pCImage->Raster = 0;
pCImage->Palette = 0;
pCImage->pbmi = 0;
return pCImage;
}
void CImageDestroy( PCIMAGE pCImage )
{
if( pCImage->pbmi )
{
hb_xfree( ( void * ) pCImage->pbmi );
pCImage->pbmi = 0;
}
if( pCImage->Raster )
{
hb_xfree( ( void * ) pCImage->Raster );
pCImage->Raster = 0;
}
}
void CImageAssign( PCIMAGE pCImage, PCIMAGE pCAnotherImage )
{
memcpy( ( void * ) pCImage, ( void * ) pCAnotherImage, sizeof( CIMAGE ) );
}
char CImagePixel( PCIMAGE pCImage, int x, int y )
{
return PCImage->Raster[ y * pCImage->BytesPerRow + x ];
}
#include <hbapi.h>
#include <windows.h>
typedef struct
{
unsigned char b, g, r, x;
} COLOR;
typedef struct
{
int Width, Height; // Dimensions in pixels
int BPP; // Bits Per Pixel
char * Raster; // Bits of Raster Data (Byte Aligned)
COLOR * Palette; // Color Map
int BytesPerRow; // Width (in bytes) including alignment!
int Transparent; // Index of Transparent color (-1 for none)
// Extra members for animations:
int xPos, yPos; // Relative Position
int Delay; // Delay after image in 1/1000 seconds.
int Transparency; // Animation Transparency.
// Windows GDI specific:
BITMAPINFO * pbmi; // BITMAPINFO structure
} CIMAGE, * PCIMAGE;
PCIMAGE CImageNew( void )
{
PCIMAGE pCImage = ( PCIMAGE ) hb_xgrab( sizeof( CIMAGE ) );
pCImage->Raster = 0;
pCImage->Palette = 0;
pCImage->pbmi = 0;
return pCImage;
}
void CImageDestroy( PCIMAGE pCImage )
{
if( pCImage->pbmi )
{
hb_xfree( ( void * ) pCImage->pbmi );
pCImage->pbmi = 0;
}
if( pCImage->Raster )
{
hb_xfree( ( void * ) pCImage->Raster );
pCImage->Raster = 0;
}
}
void CImageAssign( PCIMAGE pCImage, PCIMAGE pCAnotherImage )
{
memcpy( ( void * ) pCImage, ( void * ) pCAnotherImage, sizeof( CIMAGE ) );
}
char CImagePixel( PCIMAGE pCImage, int x, int y )
{
return pCImage->Raster[ y * pCImage->BytesPerRow + x ];
}
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 44 guests