Hello
Thanks to forum members
Question1:Why always holds the first pixel value 183 In the 4 bytes ( Alpha) of bitmap..?
procedure TForm1.Button1Click(Sender: TObject);
var FPixelsData: Pbyte;
ox :Integer;
bitm:tbitmap;
begin
bitm:= tbitmap.Create;
bitm.LoadFromFile('whiteImage.bmp');//
// PixelFormat from (any) to pf32bit //I did not find a way to convert to 32 .. I used canvas
bitm.Canvas.Rectangle(200,200,200,200);
FPixelsData:=bitm.RawImage.Data;
for ox := 1 to 8 do begin //rgba
writeln('bayt[',ox,']',Byte(FPixelsData^));
Inc(PByte(FPixelsData),1);
end;
end;
bayt[1]255
bayt[2]255
bayt[3]255
bayt[4]183 <------------this Problem
bayt[5]255
bayt[6]255
bayt[7]255
bayt[8]0 <------------Correct value here, and all the remaining bits...?
Note:
I used Image To read information only, without change it, to copy data to TFastBitmap
http://wiki.freepascal.org/Fast_direct_pixel_accessQuestion2:When used ReAllocMem for size largest memory 'Why does not the data is saved in swap partition (linux)
If i'am wrong in my information
Please .. How can I use (swap partition)
Question3: Is it possible to save a piece of memory , Example (RawImage.Data) ,and load it ,Without the use other areas in the memory...?
Example;
pchar := pchar(RawImage.Data)
ReAllocMem(pchar,RawImage.sizeData); ///I know that this is impossible(other pointer local ) only to clarify
Write(File.bak,pchar);
Note:
sys : linux
gui : gtk2
cpu : i386
fpc : 2.4.2-0 [2010/11/11]
lazarus :0.9.30