2013/2/4 silvioprog <[email protected]>
> 2013/2/4 leledumbo <[email protected]>
>
>> > 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
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus