Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8326761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:52:31+00:00 2026-06-09T00:52:31+00:00

I want to create a PIX data structure from a UIImage. The struct of

  • 0

I want to create a PIX data structure from a UIImage. The struct of PIX:

struct Pix
{
     l_uint32             w;           /* width in pixels                   */
     l_uint32             h;           /* height in pixels                  */
     l_uint32             d;           /* depth in bits                     */
     l_uint32             wpl;         /* 32-bit words/line                 */
     l_uint32             refcount;    /* reference count (1 if no clones)  */
     l_int32              xres;        /* image res (ppi) in x direction    */
                                       /* (use 0 if unknown)                */
     l_int32              yres;        /* image res (ppi) in y direction    */
                                       /* (use 0 if unknown)                */
     l_int32              informat;    /* input file format, IFF_*          */
     char                *text;        /* text string associated with pix   */
     struct PixColormap  *colormap;    /* colormap (may be null)            */
     l_uint32            *data;        /* the image data                    */
 };
 typedef struct Pix PIX;


struct PixColormap
 {
     void            *array;     /* colormap table (array of RGBA_QUAD)     */
     l_int32          depth;     /* of pix (1, 2, 4 or 8 bpp)               */
     l_int32          nalloc;    /* number of color entries allocated       */
     l_int32          n;         /* number of color entries used            */
};

How can I do this in iOS?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:52:33+00:00Added an answer on June 9, 2026 at 12:52 am

    You can create a CGBitmapContext and draw the image into it. You need to use the RGB color space to create the context. You may need to experiment with kCGBitmapByteOrder32Little and kCGBitmapByteOrder32Big in the bitmapInfo argument to get the R, G, and B components in the correct order.

    Then you can initialize your struct Pix from that, using functions like CGBitmapContextGetWidth, CGBitmapContextGetBytesPerRow, and CGBitmapContextGetData. The xres, yres, informat, text, and colormap elements don’t correspond to any attributes of CGBitmapContext or UIImage, so you should probably set them to 0 or NULL.

    Take a look at the CGBitmapContext Reference for help with CGBitmapContext.

    Also look at the Quartz 2D Programming Guide for help creating a bitmap context, and for help drawing your image into the context.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want create a custom json data from the mssql 2008 results so that
I want to create a Silverlight app to extract and manipulate data from an
i want create multiple search where statement $where_search is a multiple condition from post
I want create a ModelForm class where model is a parameter passed from the
I want create texture atlas(matrix of images) from multiple images.Is their any applescript that
I want create Word document from another Word document, but I need replace some
I want create object from Canvas3D class(in java) but my Compiler doesn't have this
I want create simple puzzle to select random 5 names from input. Lets say
i want create simple app in which i want get the image from sdcard
I want create xml file of this structure: <Devices> <Device Number=58 Name=Default Device >

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.