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

  • Home
  • SEARCH
  • 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 7059937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:17:32+00:00 2026-05-28T04:17:32+00:00

I want to fetch highest NSBitmapImageRep from NSImage object. For example if NSImage object

  • 0

I want to fetch highest NSBitmapImageRep from NSImage object.
For example if NSImage object contain:

NSIconRefBitmapImageRep 0x1272d0 Size={128, 128} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=128x128 Alpha=YES Planar=NO Format=0 CurrentBacking=nil (faulting),
NSIconRefBitmapImageRep 0x11b330 Size={256, 256} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=256x256 Alpha=YES Planar=NO Format=0 CurrentBacking=nil (faulting),
NSIconRefBitmapImageRep 0x19fe10 Size={512, 512} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=512x512 Alpha=YES Planar=NO Format=0 CurrentBacking=nil (faulting),
NSIconRefBitmapImageRep 0x124d10 Size={32, 32} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=32x32 Alpha=YES Planar=NO Format=0 CurrentBacking=nil (faulting),
NSIconRefBitmapImageRep 0x142180 Size={16, 16} ColorSpace=Generic RGB colorspace BPS=8 BPP=32 Pixels=16x16 Alpha=YES Planar=NO Format=0 CurrentBacking=nil (faulting)  

then i want {512 , 512} representation. I am using below code for this.

NSBitmapImageRep* requiredBitmap = nil;
    BOOL setValue =NO;

    NSEnumerator* imageEnum = [[origImage representations] objectEnumerator];

    while( imagerep = [imageEnum nextObject])
    {
        if ([imagerep isKindOfClass:[NSBitmapImageRep class]]) 
        {
            if (!setValue) {
                requiredBitmap = imagerep;
                setValue =YES;
            }
            if ([requiredBitmap pixelsHigh]<[imagerep pixelsHigh]) {
                requiredBitmap = imagerep;

                NSLog(@"%d", [imagerep pixelsHigh]);

            }
        }
    }


    NSImage* original512Image;

    if( requiredBitmap )
    {
        original512Image = [[NSImage alloc] initWithData:[requiredBitmap TIFFRepresentation]];


}  

Is there any efficient way to do this?

  • 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-05-28T04:17:32+00:00Added an answer on May 28, 2026 at 4:17 am

    I am using

    id imageRep = nil;
    
    NSSize largImageSize;
    
    BOOL setValue =NO;
    
    NSEnumerator* imageEnum = [[lOriginalImage representations] objectEnumerator];
    
    while((imageRep = [imageEnum nextObject])) {
    
        if (!setValue) {
            largImageSize = [imageRep size];
            setValue =YES;
        }
        else if ((largImageSize.height) < ([imageRep size].height)) {
            largImageSize = [imageRep size];
        }
    
    }
    
    
    [lOriginalImage setSize:largImageSize];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to fetch data from MySQL without creating object from class Normally I
I want to fetch the unmatching records from two table in SQL, the table
I want to fetch a method's comments,take below method for example: /** * Returns
i want to fetch information from the database using objects. i really like this
In asp.net(C#) i want to fetch data from a database using a stored procedure
I want to fetch data from separate tables in sqlserver and display them together
I want to fetch multiple feeds from the database and in so doing fetch
I want to fetch div element from other website . on which iam having
I want to fetch all hits from lucene. Is there any wild card character
I want to fetch the Froyo source code from aosp, but I get the

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.