Solved

Glyph.Data in DFM - converting to BMP

Posted on 2004-09-27
7
2,148 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 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
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month3 days, 15 hours left to enroll

630 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