UISlider Default Images?

Discussion in 'iOS Programming' started by Darkroom, Jun 27, 2009.

  1. Darkroom Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #1
    where can i find the default track and thumb images for UISlider in
    the iPhone SDK?
     
  2. Darkroom thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #2
    perhaps the images aren't readily available? are they programatically created?

    i only really want to change the track images on my slider, but when change them, the standard thumb disappears (annoying!), so i have to supply a thumb as well.

    any ideas?
     
  3. Darkroom thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #3
    alright... seems to be a mystery... no better time than to break out the old Illustrator, i guess :rolleyes:

    so, if anyone ever finds themselves in my position, my attempt to emulate the default thumb is attached. please help yourselves.
     

    Attached Files:

  4. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
  5. Darkroom thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #5
    i can't seem to extract the UIKit artwork. following the topic on this blog doesn't help.

    i've created a view-based app, pasted that code in the view controller implementation, and set it to activate the action with viewDidLoad:

    Code:
    #import <UIKit/UIKit.h>
    
    @interface _ViewController : UIViewController {
    
    }
    - (IBAction)extractArtwork:(id)sender;
    @end
    
    Code:
    #import <mach-o/dyld.h>
    #import <mach-o/nlist.h>
    #import "_ViewController.h"
    
    @implementation _ViewController
    
    
    
    extern UIImage *_UIImageWithName(NSString *);
     
    - (NSMutableDictionary*) UIKitImages
    {
        NSMutableDictionary *mappedImages = nil;
     
        for(uint32_t i = 0; i < _dyld_image_count(); i++) {
            if (strstr(_dyld_get_image_name(i), "UIKit.framework")) {
                struct nlist symlist[] = {{"___mappedImages", 0, 0, 0, 0}, NULL};
                if (nlist(_dyld_get_image_name(i), symlist) == 0 && symlist[0].n_value != 0) {
                    mappedImages = (NSMutableDictionary*)*(int*)symlist[0].n_value;
                }
                break;
            }
        }
     
        return mappedImages;
    }
     
    - (IBAction) extractArtwork:(id)sender
    {NSLog(@"extracting...");
        for (NSString *imageName in [[self UIKitImages] allKeys]) {
            NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
            NSString *imagePath = [documentsPath stringByAppendingPathComponent:imageName];
            [UIImagePNGRepresentation(_UIImageWithName(imageName)) writeToFile:imagePath atomically:YES];
        }
    }
    
    
    - (void)viewDidLoad {
    [self extractArtwork:nil];
        [super viewDidLoad];
    }
    
    @end
    
    nothing happens. the method is executed as i can see the "extracting..." NSLog in the console, but no images are written to my documents folder.
     
  6. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #6
    It worked for me. What version of the Sim OS are you running under. What happens if you NSLog the imageAddress?
     
  7. Darkroom thread starter Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #7
    was using Simulator OS 3.0... but it's fine, i actually extracted the .PNGs from UIKit.framework's Other.artwork file using iPhoneShop.
     

Share This Page