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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:04:28+00:00 2026-06-16T08:04:28+00:00

Basically, I am making a view that has two images. Image one is shown

  • 0

Basically, I am making a view that has two images. Image one is shown in a right triangle that takes up the top left of the view, and image two takes the up the right triangle that takes up the bottom right.

Imagine a square cut diagonally, a different image exists in each resulting half.

I’ve been reading a lot about masks, but I don’t want to use another image to mask these images.

I’m looking for a way to give it 3 points, which form that triangle, and then have it clip the image that way.

I feel like this is probably easy to do in Coregraphics, I’m just missing the calls I think.

Any help is greatly appreciated!

  • 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-16T08:04:29+00:00Added an answer on June 16, 2026 at 8:04 am

    Here’s one way, using clipping paths on an image context. The example is for an image size of 256 x 256, but you should easily be able to adapt it to your needs.

    UIGraphicsBeginImageContext(CGSizeMake(256, 256));
    CGContextRef context = UIGraphicsGetCurrentContext();
    CGAffineTransform flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, 256); 
    CGContextConcatCTM(context, flipVertical);
    CGContextBeginPath(context);
    CGContextMoveToPoint(context, 0, 0);
    CGContextAddLineToPoint(context, 0, 256);
    CGContextAddLineToPoint(context, 256, 256);
    CGContextClosePath(context);
    CGContextSaveGState(context);
    CGContextClip(context);
    CGContextDrawImage(context, CGRectMake(0, 0, 256, 256), [image1 CGImage]);
    CGContextRestoreGState(context);
    CGContextBeginPath(context);
    CGContextMoveToPoint(context, 0, 0);
    CGContextAddLineToPoint(context, 256, 0);
    CGContextAddLineToPoint(context, 256, 256);
    CGContextClosePath(context);
    CGContextSaveGState(context);
    CGContextClip(context);
    CGContextDrawImage(context, CGRectMake(0, 0, 256, 256), [image2 CGImage]);
    CGContextRestoreGState(context);
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); // image contains the result
    UIGraphicsEndImageContext();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I'm making a list view that you can add things to the top
When I create a view I am basically making a new table that will
So I'm basically making an app that adds a count to a number and
I'm making a Android app that basically plays video from a website on the
I am making a top-down shooter that makes extensive use of TMX maps created
I have a table with records that has delete links. Basically I followed the
I'm making Android app that has this database in it: public void onCreate(SQLiteDatabase db)
Okay, so I am basically making a script to pass post data using cURL.
I'm using AFJSONRequestOperation in an iPhone app (targeting iOS 5) - basically making a
I am developing a small app while learning Android. The app is basically making

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.