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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:56:19+00:00 2026-05-13T21:56:19+00:00

I want to add a FADED shadow/outer glow to a UIImage / UIImageView /

  • 0

I want to add a FADED shadow/outer glow to a UIImage/UIImageView/UIView but I know no Core Graphics at all.

Edit:
Please 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-13T21:56:20+00:00Added an answer on May 13, 2026 at 9:56 pm

    Take the approach outlined by Cirrostratus, keep a cached copy of it, and then apply a transform to change the size and/or position of the image while dragging.

    (warning, this is not functional/tested code, but should get you started)

    -(UIImage*)addGlowToImage:(UIImage*)imageInput;
    {
        CGRect newSize = imageInput.bounds;
        CGImageRef theImage = imageInput.CGImage;
    
        // expand the size to handle the "glow"
        newSize.size.width += 6.0;
        newSize.size.height += 6.0;
        UIGraphicsBeginImageContext(newSize);
        CGContextRef ctx = UIGraphicsGetCurrentContext();
    
        CGContextBeginTransparencyLayerWithRect(ctx, newSize, NULL);
        CGContextClearRect(ctx, newSize);
    
        // you can repeat this process to build glow.
        CGContextDrawImage(ctx, newSize, theImage); 
        CGContextSetAlpha(ctx, 0.2);  
    
        CGContextEndTransparencyLayer(ctx);
    
        // draw the original image into the context, offset to be centered;
        CGRect centerRect = inputImage.bounds;
        centerRect.origin.x += 3.0;
        centerRect.origin.y += 3.0;
        CGContextDrawImage(ctx, centerRect, theImage);
    
        result = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
    
        return result;
    }
    

    Then in your method while scaling you would do something like:

    // assumes UIImage *cachedImage = [self addGlowToImage:origImage]; has been called already.
    // assumes ivars for scale exists
    
        CGRect newRect = cachedImage.bounds;
        newRect.size.width += scale;
        newRect.size.height += scale;
    
        [cachedImage drawInRect:newRect];  // image will be scaled to fill destination rectangle.
    

    Definitely take a look at the apple docs. A good starting place is the Quartz 2D Programming Guide.

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

Sidebar

Related Questions

I want add UIGestureRecognizerDelegate to UIWebView,but failed. if [self.view addsubView:webView]; So UIWebView is ok,but
I want add my custom sidebar next right column all page. Please check this
Hey all i've tried to add an other view it work properly but it
I found this content expand/collapse jQuery plugin. I want to add fade-in effect to
i have this javascript code to which i want to add the jquery fade-in
Hi when I add a new component using Actionscript I want it to fade
I want add new Feed item on entity persist and update. I write this
I want add label to every row in tableview at right side of the
I have a website built with ASP.NET (3.5) and want add some level of
I have a list of string values that I want add to a hashtable

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.