Re: [NTLK] Structure of a Bitmap when passed to C

From: Paul Guyot (pguyot_at_kallisys.net)
Date: Thu Jul 07 2005 - 21:19:50 PDT


Le 8 juil. 05 =E0 12:59, Matthew Hudson a =E9crit :

> I've been searching but what I find doesn't match with the data I'm
> getting from the pointer. Is there class information at the beginning
> of the bitmap object and if so - what is the structure of that?
>
> Normally I would just dig in and find it but I have a limited time to
> get the project I'm working on done and someone pointing me in the
> right direction would be oh so helpful.

There are two structures for pictures, depending on what bitmap data =20
you have:

///
/// Structure pour les binaires bitmap.
///
/// Voici ce que j'ai =E9crit dans VNCNative.h:
/// "I found that in GIFLib.cp (for the NPDS GIF Server), but I can't =20=

recall know where I got it
/// (heh, it's one year ago)
/// Maybe Steve or another developer gave it to me.
/// It's more or less compatible with the info at
/// http://www.unna.org/unna/apple/Newton_Development/tech_info/QAs/=20
html/newtbitm.htm"
typedef struct SBits
{
     Long fPixelOffset; ///< offset of the pixels
     Short fRowBytes; ///< number of bytes per row
     Short fIgnored_1; ///< usually 0
     // rectangle - portion of bits to use--see IM I [Q&As]
     Short fTop; ///< top coordinate
     Short fLeft; ///< left
     Short fBottom; ///< bottom
     Short fRight; ///< right
     Short fIgnored_2; ///< usually 0x8000
     Char fIgnored_3; ///< usually 0x10
     Char fBitsPerPixel; ///< number of bits per pixel.
     Short fHoriRes; ///< in dpi (usually 72)
     Short fVertRes; ///< in dpi (usually 72)
     Long fIgnored_4; ///< Unknown.
} SBits;

///
/// Deuxi=E8me structure pour les binaires bitmap.
///
/// http://www.unna.org/unna/apple/Newton_Development/tech_info/QAs/=20
html/newtbitm.htm
/// R=E9sultat de MakePixFamily.
typedef struct SBits2
{
     Long fIgnored_1; ///< doit =EAtre 0
     Short fRowBytes; ///< number of bytes per row
     Short fIgnored_2; ///< ignored
     // rectangle - portion of bits to use--see IM I [Q&As]
     Short fTop; ///< top coordinate
     Short fLeft; ///< left
     Short fBottom; ///< bottom
     Short fRight; ///< right
} SBits2;

Paul
--=20
Ministre ultrapl=E9nipotentiaire en disponibilit=E9.
Mobile. Sans baignoire fixe.
http://www.kallisys.com/
http://www-poleia.lip6.fr/~guyot/

-- 
This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries
Official Newton FAQ: http://www.chuma.org/newton/faq/
WikiWikiNewt for all kinds of articles: http://tools.unna.org/wikiwikinewt/


This archive was generated by hypermail 2.1.5 : Thu Jul 07 2005 - 21:30:01 PDT