| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //
- // ScannerView.m
- // CodeScanner
- //
- // Created by Ray on 14-7-24.
- // Copyright (c) 2014年 Shinobi Controls. All rights reserved.
- //
- #import "ScannerControllerView.h"
- @implementation ScannerControllerView
- - (id)initWithFrame:(CGRect)frame
- {
- self = [super initWithFrame:frame];
- if (self) {
- // Initialization code
- }
- return self;
- }
- // Only override drawRect: if you perform custom drawing.
- // An empty implementation adversely affects performance during animation.
- - (void)drawRect:(CGRect)rect
- {
- CGContextRef con = UIGraphicsGetCurrentContext();
-
- CGContextSetFillColorWithColor(con, [[UIColor colorWithRed:0 green:0 blue:0 alpha:0.5] CGColor]);
-
- CGContextFillRect(con, rect);
- //CGRect frame =CGRectMake(100,100,300,300);
-
- CGContextClearRect(con, self.highLightRect);
- // Drawing code
-
-
-
- if(!self.auto_style)
- {
- // CGRect frame = self.contentView.frame;
-
- // // CGContextAddRect(context,frame);
- CGContextSetLineWidth(con, 1.0);
- //
- CGContextSetStrokeColorWithColor(con, [[UIColor redColor] CGColor]);
- //
- // CGRect selrect = self.highLightRect;
-
- CGContextMoveToPoint(con, self.highLightRect.origin.x, self.highLightRect.origin.y+ self.highLightRect.size.height/2.0);
-
- CGContextAddLineToPoint(con, self.highLightRect.origin.x+ self.highLightRect.size.width, self.highLightRect.origin.y+self.highLightRect.size.height/2.0);
- //
- CGContextStrokePath(con);
- }
-
- [super drawRect:rect];
- }
- @end
|