Тег ‘UIImage’:

UIImage and Memory

+[UIImage imageNamed:]
• Reads the file, uncompresses it, caches result
• Cached copy of data is kept even if the UIImage is deallocated
• Low memory condition causes cache to be purged.
• No direct control over when cache is purged.
• Use for small frequently drawn images.
+[UIImage imageWithContentsOfFile:]
• Just reads enough of file to determine if it can open [...]

Теги: , , , , , , , ,

Комментарии отсутствуют

Streatch image with stretchableImageWithLeftCapWidth: topCapHeight:

Sample
+ (UIImage*)greenBubble
{
    if (sGreenBubble == nil) {
        UIImage *i = [UIImage imageNamed:@"Balloon_1.png"];
        sGreenBubble = [[i stretchableImageWithLeftCapWidth:15 topCapHeight:13] retain];
    }
    return sGreenBubble;
}
 
+ (UIImage*)grayBubble
{
    if (sGrayBubble == nil) {
        UIImage *i = [UIImage imageNamed:@"Balloon_2.png"];
        sGrayBubble = [[i stretchableImageWithLeftCapWidth:21 topCapHeight:13] retain];
    [...]

Теги: , , , , ,

Комментарии отсутствуют

Radio buttons for iPhone application

Presented simple and nice solution for radio buttons, based on the UIButton.
Add buttons on view of controller
for (int i = 0; i < 5; i++) {
        UIButton *but = [UIButton buttonWithType:UIButtonTypeCustom];
        [but setImage:[UIImage imageNamed:@"checkbox.png"] forState:UIControlStateNormal];
        [but setImage:[UIImage imageNamed:@"checkedbox.png"] forState:UIControlStateSelected];
        [but setFrame:CGRectMake(0, 0, 17, [...]

Теги: , , , , , , , ,

Комментариев (2)

Change RGB color of the picture

Change RGB color of the picture
- (UIImage *) changeColor: (UIImage *)image {
    UIGraphicsBeginImageContext(image.size);
   
    CGRect contextRect;
    contextRect.origin.x = 0.0f;
    contextRect.origin.y = 0.0f;
    contextRect.size = [image size];
    // Retrieve source image and begin image context
    CGSize itemImageSize = [image size];
    CGPoint itemImagePosition;
    itemImagePosition.x = ceilf((contextRect.size.width [...]

Теги: , , ,

Комментарии отсутствуют

Source of SlideShow

Реализация слайдшоу!
Мелочь, которую можно быстро вставить в свой проект!
Компакто, в плане кода!

Спасибо разработчику, ресурс!
Mirror

Теги: , , ,

Комментарии отсутствуют

Дизайним интерфейс в приложениях iPhone

На сегодняшний день всем хочется красивости и примочек, iPhone приложения не исключения! Вот реализовал по своему. Может кому покажется не так. Если у вас есть другие, более оптимальные варианты реализации, буду рад выслушать.
Вот что из этого получилось:
Объект first выдвигается и задвигается с левой стороны, а second с правой стороны, плюс можно перемещать за любое место [...]

Теги: , , , , ,

Комментарии отсутствуют