Good morning everyone, is there any way I can create a bitmap trough of a binary code? follows a txt file with the code I have.
Link: https://mega.co.nz/#!aR8AmLJL!ce5fqX-IP ... 9pkOpO-X44
Good morning everyone, is there any way I can create a bitmap trough of a binary code? follows a txt file with the code I have.
Link: https://mega.co.nz/#!aR8AmLJL!ce5fqX-IP ... 9pkOpO-X44
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);
}Good morning, thank you for attention and now I apologize for not understanding how to work right. The code that returns FastReport for me this is the link I posted in the first topic q. It generates only one line, how should I fill the vector with these my data? just a vector or a matrix of various vectors? and how to add'll call this bitmap? The function that I have to add a Bitmap to FastReport is this:
FrPrn: AddPicture ("ReportTitle1", "Name", "C: \ test.bmp", 20, 20, 200, 200) / / ( Mirror: AddPicture (cParent, cName, cFileName, Nleft, NTOP, nWidth, nHeight) )
It's just the cFileName I wish not to use. How do I assimilate the function that you pass to cFileName? that will fill a variable with the result of the function work?
Thank you for your attention.
#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
HBITMAP CreateMemBitmap3( void * cBitmap );
it is a new function included in FWH 13.07
Antonio Linares wrote: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 )Antonio, I really liked it and this is exactly q I wish. I'm surprised, I have to confess, but would like to see if there is a possibility of doing something else. Upload this picture in FastReport. If you or someone you know I am extremely grateful. I tried but could not.
This is the syntax to add an image in FastReport:
AddPicture (cParent, cName, cFileName, Nleft, NTOP, nWidth, nHeight)
cParent = is the object where the image is affiliated (Ex: 'Page1')
cName = Name that the object of BMP will take the report
cFileName = Image path.
Here is exactly where I wanted to work. I thank you all.
Enrico Maria Giordano wrote:Antonio,
Antonio Linares wrote:ON PAINT DrawBitmap( hDC, hBitmap, 0, 0 )
Which is better between
ON PAINT DrawBitmap( hDC, hBitmap, nTop, nLeft, nWidth, nHeight )
and
ON PAINT PalBmpDraw( hDC, 0, 0, hBitmap, , nWidth, nHeight )
?
EMG
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())
Arthur,
I don't use FastReport but I am sure that any FastReport user will be able to help you ![]()
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().
Enrico,
Could you provide an example to check what you comment ? thanks