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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:04:35+00:00 2026-05-23T12:04:35+00:00

In my application i have used mapview. On particular place i can put annotation.

  • 0

In my application i have used mapview. On particular place i can put annotation. i want to take the snap shot of that place with annotation in it.

i tried to implement this.

CGSize size = self.view.bounds.size;
CGRect screensize = CGRectMake(40,40,size.width-240,size.height-400);
UIGraphicsBeginImageContext(screensize.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenshotImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(screenshotImage, nil, nil, nil);

UIGraphicsEndImageContext();

this code takes the snap but it takes the snap from (0,0) coordinates. i want to take the snap from (40,40) coordinates and the size of the image should be 80*80.

How can i 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-23T12:04:36+00:00Added an answer on May 23, 2026 at 12:04 pm

    I don’t think you can do it directly. Get the entire image and the crop the desired region.

    CGSize size = self.view.bounds.size;
    CGRect cropRect = CGRectMake(40, 40, 80, 80);
    
    /* Get the entire on screen map as Image */
    UIGraphicsBeginImageContext(size);
    [self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage * mapImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    
    /* Crop the desired region */
    CGImageRef imageRef = CGImageCreateWithImageInRect(mapImage.CGImage, cropRect);
    UIImage * cropImage = [UIImage imageWithCGImage:imageRef]; 
    CGImageRelease(imageRef);
    
    /* Save the cropped image */
    UIImageWriteToSavedPhotosAlbum(cropImage, nil, nil, nil);
    
    UIGraphicsEndImageContext();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a Windows application, that can take in some command line arguments
Has Anyone tried using PDF in iPad Application, using CGPDf functions. I have used
I have an application used by pretty tech-savey people and they want small island
I have used MKReverseGeocoder from iPhone sdk for my application without using mapview of
I have an application which used top bar navigation and a MapView. On the
I have an application that can import an XML file through this terminal command
In my application I have used a generic handler to serve requests. I want
I see an application have used Log.info = some info where are these logs
i have used impersonation in this application. whenever this error occurs i required to
i have used progress bar in my application..my application is working fine but 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.