Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Crop an Image

Discussion in 'Scripting' started by Diversity276, Jun 8, 2015.

  1. Diversity276

    Diversity276

    Joined:
    Mar 22, 2014
    Posts:
    51
    Hey Unity3D-Community,

    again a question from me. Hope for some ideas or inspiration. May a user already created something and is free to share.
    I search for a method to crop an image (texture) with a user-friendly control. I've found a solution from AppGuruz where i can crop a image by making a rect and the image which is outside of the rect will be removed.

    The only problem is, than when i've made the rect it instantly getting cutted and is not resizeable and i want to give a needed aspect ratio like 4:3, 16:9 ...

    Example: http://i.stack.imgur.com/QIKv0.png

    May you have an idea.

    Best regards from Germany

    Diversity
     
  2. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,732
  3. Diversity276

    Diversity276

    Joined:
    Mar 22, 2014
    Posts:
    51
    Hi Munchy thanks for your reply. Thats looks very nice. May someone now knows a methode to zoom in and out on an image?

    Best regards
     
  4. Diversity276

    Diversity276

    Joined:
    Mar 22, 2014
    Posts:
    51
    Hey i could already fixed my resize Problem.

    But have a other one. How did i get the image shown inside of the uimask. It would be good if the image keeps the Resolution.

    Is there a way to get the sprite or texture 2d
     
  5. bhunterd

    bhunterd

    Joined:
    Oct 6, 2016
    Posts:
    27