Solved

Glyph.Data in DFM - converting to BMP

Posted on 2004-09-27
7
1,976 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 33

Accepted Solution

by:
Slick812 earned 200 total points
Comment Utility
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
Comment Utility
That looks excellent!  I'llhave a proper look and get back to you shortly.

Cheers!

Stuart
0
 
LVL 33

Expert Comment

by:Slick812
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
This video discusses moving either the default database or any database to a new volume.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

16 Experts available now in Live!

Get 1:1 Help Now