Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > 8c86774a3e53d77cc119f53a2b94a57a > files > 362

root-tutorial-5.34.14-2.fc18.noarch.rpm

#import <cassert>

#import <QuartzCore/QuartzCore.h>

#import "PictView.h"

@implementation PictView

//_________________________________________________________________
- (id) initWithFrame : (CGRect) frame andIcon : (NSString *) iconName
{
   assert(iconName != nil && "initWithFrame:andIcon:, parameter 'iconName' is nil");

   self = [super initWithImage : [UIImage imageNamed : iconName]];
   
   if (self) {
      self.frame = frame;
      //View is transparent with shadow (under non-transparent pixels in a picture).
      self.opaque = NO;
      self.alpha = 0.5f;
      self.layer.shadowColor = [UIColor blackColor].CGColor;
      self.layer.shadowOpacity = 0.7f;
      self.layer.shadowOffset = CGSizeMake(3.f, 3.f);
      self.userInteractionEnabled = YES;
   }
   
   return self;
}

@end