FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BUFFER CONVERSION TO BITMAP
Posts: 117
Joined: Mon Aug 13, 2007 05:22 PM
BUFFER CONVERSION TO BITMAP
Posted: Tue Mar 10, 2020 01:59 PM

Is there any function to read a bmp byte by byte return file and convert to pixel and create the bitmap

This is a return of the biometrics image

Marcelo Ferro da Silveira

Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8

SqlLib /xMate/WS
Posts: 117
Joined: Mon Aug 13, 2007 05:22 PM
Re: convert file to bmp
Posted: Tue Mar 10, 2020 07:00 PM

This is the equivalent that exists in Delphi.

BUFFER CONVERSION TO BITMAP

FREECALL/DELPHI

Function RetornaBitMap(biometria : TDigital) : TBitMap;
var
srcBmp: TBitmap;
Color : TColor;
X,Y : Integer;
baite : Byte;
begin
try
srcBmp := TBitmap.Create;
srcBmp.Width := biometria.X;
srcBmp.Height := biometria.Y;
For X := 0 to biometria.X - 1 do
begin
For Y := 0 to biometria.y do
begin
baite := biometria.img[x + srcBmp.Width * y];
srcBmp.canvas.Pixels[X,Y] := RGB(baite, baite, baite);
end;
end;
finally
result := srcBmp;
end;
end;

Since I need to do the same thing for xHarbour

Marcelo Ferro da Silveira

Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8

SqlLib /xMate/WS
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: BUFFER CONVERSION TO BITMAP
Posted: Wed Mar 11, 2020 04:03 AM

Marcelo,

Please check function CreateMemBitmap() here:

viewtopic.php?p=230018#p230018

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 117
Joined: Mon Aug 13, 2007 05:22 PM
Re: BUFFER CONVERSION TO BITMAP
Posted: Sat Mar 21, 2020 11:28 PM
Antonio Linares wrote:Marcelo,

Please check function CreateMemBitmap() here:

viewtopic.php?p=230018#p230018



Antônio
thanks
Marcelo Ferro da Silveira

Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8

SqlLib /xMate/WS

Continue the discussion