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 653895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:26:00+00:00 2026-05-13T22:26:00+00:00

Anyone knows how to convert .jpg image to .bmp format in iphone using objective-C?

  • 0

Anyone knows how to convert .jpg image to .bmp format in iphone using objective-C?
And how i process(or RGB color) the each pixel of IPhone Device caputured image?
Is there need to conversion of image type?

  • 1 1 Answer
  • 1 View
  • 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-05-13T22:26:01+00:00Added an answer on May 13, 2026 at 10:26 pm

    You won’t be able to easily get to a bmp representation on the iPhone. In Cocoa on the Mac, it is managed by the NSBitmapImageRep class and is pretty straight forward as outlined below.

    At a high level, you need to get the .jpg into an NSBitmapImageRep object and then let the frameworks handle the conversion for you:

    a. Convert the JPG image to an NSBitmapImageRep

    b. Use built in NSBitmapImageRep methods to save in desired formats.

    NSBitmapImageRep *origImage = [self documentAsBitmapImageRep:[NSURL fileURLWithPath:pathToJpgImage]];
    NSBitmapImageRep *bmpImage = [origImage representationUsingType:NSBMPFileType properties:nil];
    
    - (NSBitmapImageRep*)documentAsBitmapImageRep:(NSURL*)urlOfJpg;
    {
    
        CIImage *anImage = [CIImage imageWithContentsOfURL:urlOfJpg];
        CGRect outputExtent = [anImage extent];
    
        // Create a new NSBitmapImageRep.
        NSBitmapImageRep *theBitMapToBeSaved = [[NSBitmapImageRep alloc]  
                                                initWithBitmapDataPlanes:NULL pixelsWide:outputExtent.size.width  
                                                pixelsHigh:outputExtent.size.height  bitsPerSample:8 samplesPerPixel:4  
                                                hasAlpha:YES isPlanar:NO colorSpaceName:NSDeviceRGBColorSpace  
                                                bytesPerRow:0 bitsPerPixel:0];
    
        // Create an NSGraphicsContext that draws into the NSBitmapImageRep.  
        NSGraphicsContext *nsContext = [NSGraphicsContext graphicsContextWithBitmapImageRep:theBitMapToBeSaved];
    
        // Save the previous graphics context and state, and make our bitmap context current.
        [NSGraphicsContext saveGraphicsState];
        [NSGraphicsContext setCurrentContext: nsContext];
        CGPoint p = CGPointMake(0.0, 0.0);
    
        // Get a CIContext from the NSGraphicsContext, and use it to draw the CIImage into the NSBitmapImageRep.
        [[nsContext CIContext] drawImage:anImage atPoint:p fromRect:outputExtent];
    
        // Restore the previous graphics context and state.
        [NSGraphicsContext restoreGraphicsState];
    
        return [[theBitMapToBeSaved retain] autorelease];
    
    }
    

    On the iPhone, BMP is not directly supported by UIKit, so you would have to drop down into Quartz/Core Graphics and manage the transformation yourself.

    Pixel by pixel processing is much more involved. Again, you should get intimately familiar with the core graphics capabilities on the device if this is a hard requirement for you.

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

Sidebar

Related Questions

anyone knows any java utility method that would convert windows paths to DOS 8.3
I was wondering if anyone knows how to automatically convert PDF's to JPGs in
Does anyone know why, using SQLServer 2005 SELECT CONVERT(DECIMAL(30,15),146804871.212533)/CONVERT(DECIMAL (38,9),12499999.9999) gives me 11.74438969709659, but
Hello is there anyone who knows how to convert the following t-sql stored procedure
Does anyone know how to write a Regex.Split in order to convert {video=my/video/file.flv,my/location.jpg} into
Does anyone knows how to convert string 2010-01 to JAN in mysql ? Thanks,
Is there anyone who knows how to convert a Map to a List I
I am wondering whether anyone knows a easy way to convert a latex math
Does anyone know how to convert long to short pathnames in .net 3.5 without
Anyone know of a nice efficient function that could convert, for example: HelloWorld -->

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.