Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Glyph.Data in DFM - converting to BMP

Posted on 2004-09-27
7
Medium Priority
?
2,249 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 23

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 34

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 34

Accepted Solution

by:
Slick812 earned 800 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 34

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

[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Integration Management Part 2
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

885 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