15,896,063 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
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;
Member 11275534
4-Dec-14 22:42pm
View
You kind of thing are you saying? Don't you know that RichEdit stores images in metafiles? And that this data is provided in an hex string? All I did is to save this data through a memory stream with an extension WMF, then I open it and the dimensions are wrong. What is the problem? If you don't know the answer, don't blame me.
Here is the fragment of the RTF:
{\pict\wmetafile8\picw7407\pich9259\picwgoal4199\pichgoal5249
010009000003703e020000005a3e02000000050000000b0200000000050000000c022b24ef1c5a
...
ffffffffffffff030000000000
}\cf2\lang1033\b\f1\fs23\par
For each 2 chars I added a "$', converted it with StrToInt and saved it. Then I opened it in Paint or GIMP and there is the image, only the dimensions are wrong. What is the difficulty?
Open an RTF with an image on Notepad yourself and see it. I even can convert it to a PNG file through ImageMagick tool.
Member 11275534
4-Dec-14 18:05pm
View
Sorry, the question is not the same. The questions are related, but I have solved some issues.
Me too would not like to edit bytes, but RichEdit forces me. There is no class I could use to edit the file in Lazarus.
RichEdit stores the images, not me, and it only informs the hex string of the image. I need to save this image. I save it as WMF, but the dimensions are wrong. I need to fix this.
In this post Microsoft recommends to edit the hex, since there is no other solution: https://social.msdn.microsoft.com/Forums/pt-BR/5b99d331-ef56-4d60-bf12-3e3b70783376/how-to-convert-a-hex-string-save-in-a-rtf-file-into-an-image-jpg-or-bmp?forum=csharpgeneral
I am using Lazarus.
Show More