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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:41:42+00:00 2026-06-08T17:41:42+00:00

I want to know, how can I change my image app background using camera

  • 0

I want to know, how can I change my image app background using camera roll images. Any ideas??? How to get the camera roll paths or something like that!!!

Thanks!!!!

  • 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-08T17:41:44+00:00Added an answer on June 8, 2026 at 5:41 pm

    the following code uses a button on a toolbar, when pressed it will bring up the camera roll and then u will be able to pick the image to set

    Start by adding the MobileCoreServices framework

    add the following code in the .h file

        #import <UIKit/UIKit.h>
    #import <MobileCoreServices/MobileCoreServices.h>
    
    @interface cameraViewController : UIViewController
    <UIImagePickerControllerDelegate,
    UINavigationControllerDelegate, UIPopoverControllerDelegate>
    
    @property (nonatomic) BOOL newMedia;
    @property (nonatomic, strong) IBOutlet UIImageView *imageView;
    @property (nonatomic, strong) UIPopoverController *popoverController;
    @property (nonatomic, strong) IBOutlet UIToolbar *toolbar;
    
    - (IBAction)useCameraRoll: (id)sender;
    @end
    

    Add the following code in the .m file:

    @synthesize imageView, popoverController, toolbar, newMedia;
    
        - (IBAction) useCameraRoll: (id)sender
    {
        if ([self.popoverController isPopoverVisible]) {
            [self.popoverController dismissPopoverAnimated:YES];
        } else {
            if ([UIImagePickerController isSourceTypeAvailable:
                 UIImagePickerControllerSourceTypeSavedPhotosAlbum])
            {
                UIImagePickerController *imagePicker =
                [[UIImagePickerController alloc] init];
                imagePicker.delegate = self;
                imagePicker.sourceType =
                UIImagePickerControllerSourceTypePhotoLibrary;
                imagePicker.mediaTypes = [NSArray arrayWithObjects:
                                      (NSString *) kUTTypeImage,
                                      nil];
                imagePicker.allowsEditing = NO;
    
                self.popoverController = [[UIPopoverController alloc]
                    initWithContentViewController:imagePicker];
    
                self.popoverController.delegate = self;
    
                [self.popoverController 
                    presentPopoverFromBarButtonItem:sender
                    permittedArrowDirections:UIPopoverArrowDirectionUp
                    animated:YES];
    
                 newMedia = NO;
            }
        }
    }
    
    
    
    #pragma mark -
    #pragma mark UIImagePickerControllerDelegate
    
    -(void)imagePickerController:(UIImagePickerController *)picker
    didFinishPickingMediaWithInfo:(NSDictionary *)info
    {
        [self.popoverController dismissPopoverAnimated:true];
        NSString *mediaType = [info
               objectForKey:UIImagePickerControllerMediaType];
        [self dismissModalViewControllerAnimated:YES];
        if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) {
            UIImage *image = [info
                objectForKey:UIImagePickerControllerOriginalImage];
    
            self.imageView.image = image;
            if (newMedia)
                UIImageWriteToSavedPhotosAlbum(image,
                   self,  
                   @selector(image:finishedSavingWithError:contextInfo:),
                   nil);
        }
        else if ([mediaType isEqualToString:(NSString *)kUTTypeMovie])
        {
                    // Code here to support video if enabled
            }
    }
    
    -(void)image:(UIImage *)image
    finishedSavingWithError:(NSError *)error
     contextInfo:(void *)contextInfo
    {
        if (error) {
            UIAlertView *alert = [[UIAlertView alloc]
               initWithTitle: @"Save failed"
               message: @"Failed to save image"
               delegate: nil
               cancelButtonTitle:@"OK"
               otherButtonTitles:nil];
            [alert show];
        }
    }
    
    
    -(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
    {
       [self dismissModalViewControllerAnimated:YES];
    }
    

    Add the following in viewDidUnload:

    - (void)viewDidUnload {
        self.imageView = nil;
        self.popoverController = nil;
        self.toolbar = nil;
    }
    

    Dont forget to connect the imageview to your image and the cameraroll button to your button.

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

Sidebar

Related Questions

I want my app to have a settings that can change image when user
I want to know if you can change how a highcharts.js chart is rendered.
I want to know how can I read attachment messages without using scriplets in
What I want to know is if you can change the default color value
In photoshop I created images 0.png thru 9.png and know I can change each
I want to know how I can change a normal default grey HTML button
I want to know can we have a JPanel with a Layout other than
i want know how i can manage multiple twitter account on iOS in my
I want to know how can a retrieve a UIImage size, depending on the
I want to know how can we know the other users of Oracle 10g

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.