Click here to Skip to main content
15,896,063 members

Comments by Member 11275534 (Top 7 by date)

Member 11275534 11-May-15 11:49am View    
The image is here: http://postimg.org/image/ty2kn3yvp/
Member 11275534 11-May-15 10:40am View    
I am guessing that it is on libMut.so because example page cites Mut.h. So I tried:

function naturalstrcmp(s, t: PChar): Integer; external 'libMut.so' name 'naturalstrcmp';

but Lazarus debugger returns an error condition when running.
Member 11275534 11-May-15 6:30am View    
Well, now I know that they are on /usr/lib/alliance/, but don't know the name of the lib. All files are named as libAbc.so.
Member 11275534 11-May-15 4:21am View    
The problem is that I don't know which is the library name, I know only the package name, Alliance.
Member 11275534 5-Dec-14 13:55pm View    
RichEdit metafile data can not be accepted by ComputeAldusChecksum routine nor get a handle from SetWinMetaFileBits API call, which would convert it to an EMF format, although it can be opened as valid by GIMP, for instance, in this case even with the proper width and height, without any error. I think it happens because GIMP calculates these values at the moment it opens the file from the values of my screen resolution.

procedure TMetafile.ReadWMFStream(Stream: TStream; Length: Longint);
var
WMF: TMetafileHeader;
BitMem: Pointer;
MFP: TMetaFilePict;
begin
NewImage;
Stream.Read(WMF, SizeOf(WMF));
if (WMF.Key <> WMFKEY) or (ComputeAldusChecksum(WMF) <> WMF.CheckSum) then
raise EComponentError.Create('Invalid metafile.'); // <<<<<<<<<<<<<<< exception here
Dec(Length, SizeOf(WMF));
GetMem(Bitmem, Length);
with FImage do
try
Stream.Read(BitMem^, Length);
FImage.FInch := WMF.Inch;
if WMF.Inch = 0 then
WMF.Inch := 96;
FWidth := MulDiv(WMF.Box.Right - WMF.Box.Left,25400,WMF.Inch);
FHeight := MulDiv(WMF.Box.Bottom - WMF.Box.Top,25400,WMF.Inch);
with MFP do
begin
MM := MM_ANISOTROPIC;
xExt := 0;
yExt := 0;
hmf := 0;
end;
FHandle := SetWinMetaFileBits(Length, BitMem, 0, MFP);
if FHandle = 0 then
raise EComponentError.Create('Invalid metafile.'); // <<<<<<<<<<<<<< exception here
Enhanced := False;
finally
Freemem(BitMem, Length);
end;
end;