DWORD orange2007s[23][26]={
{ 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde, 0xfffdde},
{ 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3, 0xfff9d3},
{ 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9, 0xfff6c9},
{ 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf, 0xfff3bf},
{ 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5, 0xfff0b5},
{ 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754, 0xffd754},
{ 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f, 0xfcd34f},
{ 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b, 0xf9d04b},
{ 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47, 0xf6cd47},
{ 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43, 0xf3ca43},
{ 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f, 0xf0c73f},
{ 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a, 0xedc43a},
{ 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136, 0xebc136},
{ 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32, 0xe8be32},
{ 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e, 0xe5bb2e},
{ 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a, 0xe2b82a},
{ 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425, 0xdfb425},
{ 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121, 0xdcb121},
{ 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d, 0xd9ae1d},
{ 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19, 0xd7ab19},
{ 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815, 0xd4a815},
{ 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g, 0xd1a50g},
{ 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c, 0xcea20c}
};
HB_FUNC( BRUSH2007ORANGES )
{
HBITMAP hBmp;
hBmp = CreateBitmap (26,23,1,sizeof(RGBQUAD)*8, orange2007s);
hb_retnl( (long) hBmp);
}
#include "FiveWin.ch"
function Main()
local cFile := MemoRead( "bitmap.txt" )
local nPos := 19
local cBytes := ""
local oWnd, hBitmap
while nPos < Len( cFile ) - 19
cBytes += Chr( HexToDec( SubStr( cFile, nPos, 2 ) ) )
nPos += 2
end
MemoWrit( "arthur.txt", cBytes )
hBitmap = BuildBitmap( SubStr( cBytes, 23 ) )
DEFINE WINDOW oWnd
ACTIVATE WINDOW oWnd ;
ON PAINT DrawBitmap( hDC, hBitmap, 0, 0 )
MsgInfo( IsGdiObject( hBitmap ) )
DeleteObject( hBitmap )
return nil
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
HBITMAP CreateMemBitmap3( void * cBitmap );
HB_FUNC( BUILDBITMAP )
{
hb_retnl( ( LONG ) CreateMemBitmap3( ( void * ) hb_parc( 1 ) ) );
}
#pragma ENDDUMP
Antonio Linares wrote:
- Code: Select all Expand view
ON PAINT DrawBitmap( hDC, hBitmap, 0, 0 )
ON PAINT DrawBitmap( hDC, hBitmap, nTop, nLeft, nWidth, nHeight )
ON PAINT PalBmpDraw( hDC, 0, 0, hBitmap, , nWidth, nHeight )
Enrico Maria Giordano wrote:Antonio,Antonio Linares wrote:
- Code: Select all Expand view
ON PAINT DrawBitmap( hDC, hBitmap, 0, 0 )
Which is better between
- Code: Select all Expand view
ON PAINT DrawBitmap( hDC, hBitmap, nTop, nLeft, nWidth, nHeight )
and
- Code: Select all Expand view
ON PAINT PalBmpDraw( hDC, 0, 0, hBitmap, , nWidth, nHeight )
?
EMG
Antonio Linares wrote:Enrico,
For a simple bitmap painting use DrawBitmap().
If you need transparency, or to specify a raster operation, or to use a palette, then use PalBmpDraw(), (sort of an extended DrawBitmap())
ON PAINT DrawBitmap( hDC, hBitmap, nTop, nLeft, nWidth, nHeight )
Antonio Linares wrote:Enrico,
Yes, it is the simplest one
In fact it uses the source code proposed by Charles Petzold in his book "Programming Windows":
ftp://ftp.charlespetzold.com/ProgWin95/CHAP19/SHOWBIT.C
Enrico Maria Giordano wrote:I'm going to replace PalBmpDraw() with DrawBitmap().
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 97 guests