Re: Improving drawing of UIView with many many Subviews

2010-12-21 Thread Gustavo Pizano
David hello.

I just wanted to update you.

So I did the modification to subclass UIImageView instead, and just added the 
userInteractionsEnable to YES, modify my NSCoding protocols methods  + I add a 
category for th eUIImage (NSCoding) methods, and all seemd to work perfectly, 
saving time its little bit slower because it encodes the image of the 
UImageView,  but now loading times its faster.

Thanks

Gustavo



On Dec 21, 2010, at 5:57 PM, David Duncan wrote:

> Why not just use a UIImageView instead of implementing a custom UIView 
> subclass to do this? If this is all you are doing a UIImageView is very often 
> the superior choice.
> 
> On Dec 21, 2010, at 6:46 AM, Gustavo Adolfo Pizano wrote:
> 
>> and this is the drawrect method of the BCItemView
>> 
>> // Only override drawRect: if you perform custom drawing.
>> // An empty implementation adversely affects performance during animation.
>> - (void)drawRect:(CGRect)rect {
>>   // Drawing code.
>>  
>>  CGContextRef context = UIGraphicsGetCurrentContext();   
>>  CGContextSaveGState(context);
>>  CGContextTranslateCTM(context, 0, CGImageGetHeight(bc_itemImage));
>>  CGContextScaleCTM(context, 1.0, -1.0);
>>  CGContextDrawImage(context, self.bounds, bc_itemImage);
>>  CGContextRestoreGState(context);
>> 
>> }
> 
> --
> David Duncan
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Improving drawing of UIView with many many Subviews

2010-12-21 Thread Gustavo Pizano
Aha,,, I thought using UIView instead would be better, but I guess I was 
wrong.. 
I will then make the modifications then and see.. 


Thanks for the help I will keep you informed..

G. 
On Dec 21, 2010, at 5:57 PM, David Duncan wrote:

> Why not just use a UIImageView instead of implementing a custom UIView 
> subclass to do this? If this is all you are doing a UIImageView is very often 
> the superior choice.
> 
> On Dec 21, 2010, at 6:46 AM, Gustavo Adolfo Pizano wrote:
> 
>> and this is the drawrect method of the BCItemView
>> 
>> // Only override drawRect: if you perform custom drawing.
>> // An empty implementation adversely affects performance during animation.
>> - (void)drawRect:(CGRect)rect {
>>   // Drawing code.
>>  
>>  CGContextRef context = UIGraphicsGetCurrentContext();   
>>  CGContextSaveGState(context);
>>  CGContextTranslateCTM(context, 0, CGImageGetHeight(bc_itemImage));
>>  CGContextScaleCTM(context, 1.0, -1.0);
>>  CGContextDrawImage(context, self.bounds, bc_itemImage);
>>  CGContextRestoreGState(context);
>> 
>> }
> 
> --
> David Duncan
> 

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Improving drawing of UIView with many many Subviews

2010-12-21 Thread David Duncan
Why not just use a UIImageView instead of implementing a custom UIView subclass 
to do this? If this is all you are doing a UIImageView is very often the 
superior choice.

On Dec 21, 2010, at 6:46 AM, Gustavo Adolfo Pizano wrote:

> and this is the drawrect method of the BCItemView
> 
> // Only override drawRect: if you perform custom drawing.
> // An empty implementation adversely affects performance during animation.
> - (void)drawRect:(CGRect)rect {
>// Drawing code.
>   
>   CGContextRef context = UIGraphicsGetCurrentContext();   
>   CGContextSaveGState(context);
>   CGContextTranslateCTM(context, 0, CGImageGetHeight(bc_itemImage));
>   CGContextScaleCTM(context, 1.0, -1.0);
>   CGContextDrawImage(context, self.bounds, bc_itemImage);
>   CGContextRestoreGState(context);
> 
> }

--
David Duncan

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com