.rsrc files - best way to make one?

Discussion in 'Mac Programming' started by toddburch, Feb 8, 2008.

  1. macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #1
    I don't have Photoshop. I'm writing the (probably infamous) Moon Travel Planner application from "Learning Carbon". Surprisingly, most of the Project Builder info in the book still applies to Xcode, so, so far, so good.

    However, it calls for a .rsrc graphic of an image. The books web site provides all the resources needed for examples in a downloadable .sit file, but I'd rather not download stuffit to expand it.

    Is there any way, with the native apps on Tiger to create a .rsrc file from a .png or .jpg?

    Thanks, Todd
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    How are you using your image? Resources files shouldn't be used anymore. They are from the classic days. CoreGraphics has lots of functions for dealing with images with Carbon directly.
     
  3. thread starter macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #3
    Well, I'm just following the book - happily and blindly using the Project Builder instructions with Xcode!

    So, perhaps my question ought to be - how do I incorporate a .png file into a PICT area in a Carbon App that uses a nib in Xcode?

    (Say that 3 times real fast).
     
  4. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #4
  5. macrumors 68000

    tersono

    Joined:
    Jan 18, 2005
    Location:
    UK
    #5
    Do bear in mind that Carbon is on the way out - it was a transitional API between the classic OS and OS X, but is being phased out now. Expect it to be completely deprecated in the not-too-distant future.

    I'd suggest you start looking at cocoa - it's the future (and won't lead you down dead ends like .rsrc files).
     
  6. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #6
    Yes he knows :)
     
  7. thread starter macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #7
    OK, thanks kainjow. You da man. I'm reading...

    Yes, I know Carbon is the lame duck. Any principles I learn I'm sure will apply to Cocoa.

    Thanks!

    Todd
     
  8. thread starter macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #8
    For grins, and my sanity to just make it through this tutorial without having to read volumes of additional info, could someone expand this .sit file and email to me please?

    http://examples.oreilly.com/learncarbon/

    I'd be eternally grateful.

    Todd
     
  9. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #9
    Just download StuffIt Expander. It's available as a UB, and for Windows if you are on that by any chance...
     
  10. thread starter macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #10
    I tried twice earlier today. Both times, the registration dialog (that you have to fill out to get a link for the download) crashed Safari, and in doing so, screwed up all my settings, big time.

    I'll try with Firefox.
     
  11. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
  12. thread starter macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #12
    Worked with Firefox. Thanks.
     
  13. thread starter macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #13
  14. macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #14
    For reference ResEdit is the application you need for editing rsrc files. Although I haven't used it since MPW was the Apple IDE of choice.
     
  15. thread starter macrumors 6502a

    Joined:
    Dec 4, 2006
    Location:
    Katy, Texas
    #15
    I have a question about the moon.rsrc file. When I added it to IB, in the Images tab, it shows up as 3 entities:

    • ICNS: 16455
    • PICT: 32236
    • PICT: 8722

    I suspect the first one is an ICON, as it is smaller. The other two are similar in size. What's the trailing number? The size in bytes?

    Todd
     

Share This Page