Posted: Sun May 27, 2007 6:10 pm
by Antonio Linares
Tienes que usar un array en C (ó una cadena en PRG) con el contenido del bitmap, que lo puedes obtener usando el resources workshop:
BYTE Test[] = {
0x42, 0x4D, 0xF6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x00, 0x00, 0x00, 0x28, 0x00,
0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0x00, 0x00, 0xBF,
0x00, 0x00, 0x00, 0xBF, 0xBF, 0x00, 0xBF, 0x00, 0x00, 0x00, 0xBF, 0x00, 0xBF, 0x00, 0xBF, 0xBF,
0x00, 0x00, 0xC0, 0xC0, 0xC0, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0xFF,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
0x77, 0x70, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x78,
0x88, 0x88, 0x88, 0x88, 0x77, 0x77, 0x77, 0x7F, 0x77, 0x77, 0x77, 0x78, 0x77, 0x77, 0x77, 0x7F,
0x77, 0x70, 0x77, 0x78, 0x77, 0x77, 0x77, 0x7F, 0x77, 0x70, 0x77, 0x78, 0x77, 0x77, 0x77, 0x7F,
0x70, 0x00, 0x00, 0x78, 0x70, 0x70, 0x77, 0x7F, 0x77, 0x70, 0x77, 0x78, 0x77, 0x77, 0x77, 0x7F,
0x77, 0x70, 0x77, 0x78, 0x77, 0x77, 0x77, 0x7F, 0x77, 0x77, 0x77, 0x78, 0x77, 0x77, 0x77, 0x7F,
0xFF, 0xFF, 0xFF, 0xF8, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
0x77, 0x70, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77, 0x77,
0x77, 0x70, 0x77, 0x77, 0x77, 0x77 };
y luego llamando a esta función:
hb_retnl( ( LONG ) CreateMemBitmap( ( HDC ) hb_parnl( 1 ), Test ) );
que te devuelve el handle del bitmap, pasándole el hDC de donde lo vayas a usar