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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T18:12:24+00:00 2026-06-03T18:12:24+00:00

I have a rectangular NSImage A and I want to scale to embed into

  • 0

I have a rectangular NSImage A and I want to scale to embed into a squared transparent image B keeping A’s ratio. So, in the end I’ll get a squared image with the rectangle in it.

How can I compose that image?. I mean, how can I draw an NSImage over another NSImage and save the resulting image?.

I’ve been reading about clipping an NSImage inside a beizer but I need to keep ratio instead of filling the beizer square.

I hope you understand what I want.

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-03T18:12:32+00:00Added an answer on June 3, 2026 at 6:12 pm

    The ‘Cocoa Drawing Guide’ has a section called ‘Drawing to an Image’. From that documentation:

    It is possible to create images programmatically by locking focus on an NSImage object and drawing other images or paths into the image context. This technique is most useful for creating images that you intend to render to the screen, although you can also save the resulting image data to a file.

    There is example code there.

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

Sidebar

Related Questions

I have divided a rectangular shaped image into two pieces as as shown below
I have an attributed string that I want to draw bottom-aligned into a rectangular
I have N rectangular items with an aspect ratio Aitem (X:Y). I have a
I have a number of rectangular elements that I want to position in a
I have a table with two columns: latitude and longitude. I want to get
I have N squares. I have a Rectangular box. I want all the squares
In my layout, I have two rectangular semi-transparent views in the following configuration: ---------------------|
I have added one image (it is a nice painted box type thing rectangular
I have five shape draw able rectangular, I have to set the rectangle at
If I have the original transform matrix of a rectangular UIImageView and this image

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.