Solved

Glyph.Data in DFM - converting to BMP

Posted on 2004-09-27
7
2,004 Views
Last Modified: 2010-05-18
Hi folks,

I'm writing a program that opens DFMs and extracts component details from it.  I am only interested in buttons at the moment.  I'd like to be able to convert the Glyph.Data contained in the DFM to a bitmap.

Is this possible to do?  If so, can someone show me?

Cheers!

Stuart.
0
Comment
Question by:SJohnson
7 Comments
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 12165502
Why don't you look better at the question list? :)
There's an identical question asked a few ours ago, http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21146633.html#12163466
Not already accepted, but Slick812 there is right: that's the solution for you too.
0
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 12165556
I already did see it.

It doesn't work with what I want to do.  I'm trying to convert what's in the Glyph.Data inside at DFM, not a bitmap.  If I try Slick's suggestion, I just get 'Bitmap image is not valid'.  

Glyph data has no bitmap header.

Stu
0
 
LVL 33

Expert Comment

by:Slick812
ID: 12166255
hello SJohnson, In the .DFM file (as text) that I have looked at, The Bitmap is NOT stored as as string Byte data, the string in the Glyph.Data is a HEX translation of the Byte values of the Bitmap file (because you can NOT store a #0 in a string), there are  TWO hex numbers for each bitmap file byte  42 is Hex for decimal 66 or ASCI 'B'. . .  as in the folowing code

Glyph.Data = {
      460C0000424D

the first four bytes are the "Size" of the bitmap file data, the bitmap file header begins with the  42 and 4D hex which are  'B'  'M' , , ,  the id for a bitmap file header
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 33

Accepted Solution

by:
Slick812 earned 200 total points
ID: 12166387
I forgot, but I had an EE question with something like this in it at

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20438223.html
0
 
LVL 1

Author Comment

by:SJohnson
ID: 12166422
That looks excellent!  I'llhave a proper look and get back to you shortly.

Cheers!

Stuart
0
 
LVL 33

Expert Comment

by:Slick812
ID: 12172364
Oh, not sure how you get the hex string out of the DFM file, but you will have to get rid of any line feed charaters if you are reading those from the file
0
 
LVL 1

Author Comment

by:SJohnson
ID: 12176805
That worked perfectly!!!!  Thanks so much, Slick!

I've already written a parser for DFM's, so the string for the Glyph Data was already there.

Cheers!


Stu
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now