• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Is this possible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is this possible?


  • Subject: Re: Is this possible?
  • From: Development <email@hidden>
  • Date: Mon, 21 Dec 2009 13:25:50 -0700

Ok,
	I have managed to get a beautiful shadow drawn in my rotating view (A view I used to rotate images so they don't distort). The rotating view sits inside an an image view.  so it is layered as follows: ImageView(parent)->rotatingView(child)->image

Anyway. I get a lovely shadow, but there is still a problem, well two actually. First the shadow appears to be drawn on top of the image rather than under it. Second, it gets clipped to the edges of the rotating image view. I have already set rotatingView.clipsToBounds = NO; but that does not help.

Below is the code.

	UIGraphicsBeginImageContext(self.frame.size);
	CGContextRef myContext =  UIGraphicsGetCurrentContext();



    float           myColorValues[] = {0, 0, 0, darkness};// 3
    CGColorRef      myColor;// 4
    CGColorSpaceRef myColorSpace;
    CGContextSaveGState(myContext);// 6

    myColorSpace = CGColorSpaceCreateDeviceRGB ();// 9
    myColor = CGColorCreate (myColorSpace, myColorValues);// 10
    CGContextSetShadowWithColor (myContext, myShadowOffset, spread, myColor);// 11
    // Your drawing code here// 12
   // CGContextDrawImage(myContext, rotatingView.frame,imgRef);


	rotatingView.clipsToBounds = NO;
	[rotatingView.image drawInRect:rotatingView.frame
						 blendMode:kCGBlendModeNormal alpha:.5];
    CGColorRelease (myColor);// 13
    CGColorSpaceRelease (myColorSpace); // 14

	UIImage *imageCopy = UIGraphicsGetImageFromCurrentImageContext();
	CGContextRestoreGState(myContext);
	UIGraphicsEndImageContext();

	rotatingView.image = imageCopy;_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Is this possible? (From: Development <email@hidden>)
 >Re: Is this possible? (From: David Duncan <email@hidden>)
 >Re: Is this possible? (From: Development <email@hidden>)

  • Prev by Date: Outline View Enter Edit Mode.
  • Next by Date: Simple question on Menus and Document-based apps
  • Previous by thread: Re: Is this possible?
  • Next by thread: freeing memory from an NSOperation
  • Index(es):
    • Date
    • Thread