[Lazarus] Unpack of PHP
silvioprog
silvioprog at gmail.com
Mon Feb 4 16:13:47 CET 2013
2013/2/4 silvioprog <silvioprog at gmail.com>
> 2013/2/4 leledumbo <leledumbo_cool at yahoo.co.id>
>
>> > ps. I tried the Unpack function of FPC, but I don't know how to use it.
>>
>> Unpack() is for unpacking previously Pack()-ed data
>>
>
> So, I'm trying to improve the PowerPDF to support PNG images, but I dont
> know how to convert ASCII to Integer.
>
Solved:
function ReadMWord(AStream: TStream): Word;
type
TMotorolaWord = record
case Byte of
0: (Value: Word);
1: (Byte1, Byte2: Byte);
end;
var
MW: TMotorolaWord;
begin
AStream.Read(MW.Byte2, SizeOf(Byte));
AStream.Read(MW.Byte1, SizeOf(Byte));
Result := MW.Value;
end;
:)
--
Silvio Clécio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20130204/7819f139/attachment-0003.html>
More information about the Lazarus
mailing list