RSS

(root)/iphone/common : 48 : tappity/source/TappityView.m

To get this branch, use:
bzr branch /browse/iphone/common

« back to all changes in this revision

Viewing changes to tappity/source/TappityView.m

Dömötör Gulyás
2009-10-28 02:04:32
Revision ID: dognotdog@gmail.com-20091028010432-ncgjtcsyxavch41q
tappity improvements

Show diffs side-by-side

added added

removed removed

18
18
{
19
19
    if ((self = [super initWithFrame: frame]))
20
20
        {
 
21
 
21
22
    }
22
23
    return self;
23
24
}
24
25
 
 
26
- (void) setImage: (UIImage*) img
 
27
{
 
28
        @synchronized(self)
 
29
        {
 
30
                [img retain];
 
31
                [image release];
 
32
                image = img;
 
33
        }
 
34
        [self performSelectorOnMainThread: @selector(setNeedsDisplay) withObject: nil waitUntilDone: NO];
 
35
        //[self setNeedsDisplay];
 
36
}
 
37
 
 
38
 
 
39
- (void) drawRect: (CGRect) rect
 
40
{
 
41
        CGContextRef c = UIGraphicsGetCurrentContext();
 
42
        //[[UIColor blueColor] set];
 
43
        //CGContextFillRect(c, rect);
 
44
 
 
45
        CGContextSetInterpolationQuality(c, kCGInterpolationNone);
 
46
        CGContextSetAllowsAntialiasing(c, NO);
 
47
        CGContextSetShouldAntialias(c, NO);
 
48
 
 
49
        UIImage* img = nil;
 
50
        
 
51
        @synchronized(self)
 
52
        {
 
53
                img = image;
 
54
        }
 
55
 
 
56
        if (!img)
 
57
                img = [UIImage imageNamed: @"image-not-found-icon.png"];
 
58
        
 
59
        CGRect bounds = [self bounds];
 
60
 
 
61
 
 
62
 
 
63
        [img drawInRect: bounds blendMode: kCGBlendModeCopy alpha: 1.0f];
 
64
}
 
65
 
25
66
 
26
67
- (void)dealloc
27
68
{
81
122
}
82
123
*/
83
124
 
84
 
@synthesize tapClient;
 
125
@synthesize tapClient, image;
85
126
 
86
127
@end

Loggerhead 1.17 is a web-based interface for Bazaar branches