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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:25:05+00:00 2026-05-18T10:25:05+00:00

I am creating some CALayers and transforming them using CATransform3D using imageLayer.frame = CGRectMake(-22.0f,

  • 0

I am creating some CALayers and transforming them using CATransform3D using

imageLayer.frame = CGRectMake(-22.0f, 188.0f, 180.0f, 50.0f);
imageLayer.transform = CATransform3DMakeRotation(120.0f * M_PI / 180.0f,
                                                 0.0f, 15.0f, 0.0f);
imageLayer.contents = (id)[[UIImage imageNamed:@"photo.png"] CGImage];
[caLayer addSublayer:imageLayer];

here is an sample image with the output…
alt text

I have kept the untransformed image as image view so that i can handle swipes. I have an array of 10 images. So, when a user swipes on the main images the corresponding images should load up in the layers and image view. I can load the image view but had some problems loading the CALayers dynamically.

I have tried

NSArray *array=[caLayer sublayers];
    caLayer = [array objectAtIndex:entryImageIndex];
    //caLayer.contents=(id)[[UIImage imageNamed:@"flashImage1.jpg"] CGImage];
    caLayer.contents=(id)[[UIImage imageWithCGImage:[imageArray objectAtIndex:entryImageIndex-1]]];

But this gave me errors. Can anyone plz tell me how to populate the CALayers dynamically with images…Any sample code will be of great help…

  • 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-18T10:25:05+00:00Added an answer on May 18, 2026 at 10:25 am

    instead of

        caLayer.contents=(id)[[UIImage imageWithCGImage:
    [imageArray objectAtIndex:entryImageIndex-1]
    ]
    ];
    

    try

        caLayer.contents=(id)[UIImage imageWithCGImage:
    [imageArray objectAtIndex:entryImageIndex-1]
    ].CGImage;
    

    or

    caLayer.contents=(id)[imageArray objectAtIndex:entryImageIndex-1];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating some RSS feeds using PHP (5.2) from a MySQL db specifically
I am creating some buttons dynamically and assigning them IDs. When ever someone clicks
I am working on creating some grails domain objects dynamically and then adding them
I am creating some xsl to transform my xml into text (which will be
Iam using Tinymce Editor for creating some content.I used textarea for getting tinymce editor.
I'm creating some custom work items in TFS and the helptext field seems handy
I am creating some build scripts that interact with Perforce and I would like
I'm creating some text boxes on my form programmatically which I need to reference
I am considering creating some JSP-tags that will always give the same output. For
I'm creating some videos from a collection of images, I subsequently wish to play

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.