Solved

Glyph.Data in DFM - converting to BMP

Posted on 2004-09-27
7
2,097 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 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
Independent Software Vendors: 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 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 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

710 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