for Hypo ONLY

Yo Hypo!  I need some code on loading a 24bpp bitmap, bmp or pcx, in our mode..

LVL 2
VIBESPROAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HypoCommented:
I'm on it... :)
0
VIBESPROAuthor Commented:
Great....  ;) and don't forget to answer that guys ??? on jpg files

and do you know the format of TTF files??  I want to display a true type font in pascal as well... :)

if you can answer that I'll double the points...
0
VIBESPROAuthor Commented:
hey man, I'm serious about the TTF files!  If you can more points will follow!!
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

VIBESPROAuthor Commented:
oh, and for the 24bpp bitmap..
all I really need is the formula for converting it and info on how the pixels should be placed
0
RaidCommented:
Sorry to interrupt, really, but the formula is:
Read Header, then read B, G, R per pixel, and to convert the B, G, R to your graphics mode is:
B SHR 2, G SHR 2, R SHR 2.
(In other words: B DIV 4, G DIV 4, R DIV 4)
But I'm sure you knew that :)
Once again sorry for interrupting, I load 24 bit bitmap's all the time, the least I can do is help, since you and Hypo helped me.
0
RaidCommented:
Oh, and the annoying part is that the image is saved as:
Down to Up, Left to Right.
To read the bitmap file is:

Type
  BmpColType=Record
    B, G, R: Byte;
  End;
Var
  R, G, B: Byte;
  Offset: Word;
Begin
  Blockread(BmpFile, BmpHeader, Sizeof(BmpHeader));
  For Y := BmpHeader.Height-1 downto 0 Begin
    For X := 0 to BmpHeader.Width-1 do Begin
      BlockRead(BmpFile, BmpColType, Sizeof(BmpColType));
      R := BmpColType.R Shr 2;
      G := BmpColType.G Shr 2;
      B := BmpColType.B Shr 2;
      Offset := ((Yvar*BmpHeader.Width)*2)+(xvar*2);
      MemW[Sef(Buffer):Ofs(Buffer)+Offset] :=
       _CalculateColor(R, G, B);
    End;
  End;
End;

(Note: The *2 was there because you are dealing with 16bit,           which is 2 bytes)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
VIBESPROAuthor Commented:
Hey thanx Raid!  I'll give you the points for this question but I still need the info on how to read TTF files from Hypo.

No offense Hypo, Raid deserves the points.  But I still can give the points the anyone who can help with the TTF files...

Raid! you are welcome to join in!!
0
VIBESPROAuthor Commented:
if you guys have any info on TTF files send it to my email address and if it works I'll post another question for it worth 400 points
0
RaidCommented:
Do you want file format info, or all out information on to load them?
0
VIBESPROAuthor Commented:
if u have it all that will be great!!
0
HypoCommented:
Don' worry about me beeing offended...
As you already knew I've got to many things to do right now... and Raid did answer your question, so he should have the points.

Anyway... The description of the TTF format can probably be found on
http://www.Wotsit.org
As I've said before... the TTF format is build up using Vectors, not a bunch of stored sprites as other fonts are.
(That's how they solved the problem of using a dynamical sized font)
So the problem isn't just to load / decode the format, but also whenever you have to put the font on the screen.

But as soon as I'll get some time over... I'll check it out.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.