Sure, a couple things.
If you want to add something to a long, you want addi.l. Your initial code had just “addi”, which defaults to addi.w. Looks like you fixed that.
It seems you are trying to advance at the end of each line by 512 pixels = 64 bytes = 0x40. (Addresses are counted in bytes...
The ‘data’ parameter definitely works for me. This code displays “foo” right next to the ResEdit icon (only changes are replacing NULL as last argument to PlotIconMethod with “\pfoo” and adding MoveTo and DrawString calls to my IconGetter).
Try starting from my code and modifying it to fit...
You mean PlotIconMethod right (not GetIconMethod)? Yes, THINK Reference documents (some of) the Icon Utilities routines as not existing in the then-current MPW Universal Headers, so I got this info from Tech Note #306. (The .h files, if they included these routines, would just have the...
Nice.
Also, great image - does that mean you found out how to get MindJourney to generate 512x342 black and white pixel art? If so, I would love to know how!
Cool, glad that worked! I wonder why THINK didn’t do that from the start.
Yes I think those numbers look reasonable. (And of course you could draw that picture faster by coping it to a bitmap first, but that’s not your point here I gather.)
How do you get these gorgeous screendumps from your...
Oh, I do see a weird thing.
In the THINK standard library C file console.c, you can see that in the InitConsole() routine, ANSI calls InitGraf() and gives it a random pointer that doesn’t get saved anywhere. The result is that when you call InitGraf, you are setting up a separate set of...
Your code works fine for me (Mini vMac, 7.5.5), I again set the resource ID to -16503 which is the MacOS logo in the System file under 7.5.5. I think you are doing almost* everything right. The resource not showing up in ResEdit in System 6 is a bit weird, any chance there is something goofy...
You only need to lock a handle if the Memory Manager might be invoked while it is dereferenced (normally because you call a trap listed as possibly moving or purging memory). Just copying the bounds doesn’t move any memory, so no locking is needed.
The console window is just a window, you should be able to draw anything into it after a simple SetPort(FrontWindow());
You do of course need to call InitGraf() etc first. Can you post a minimal failing example of your code?
(Of course an alternative would be to skip the desktop DB and just do what the Finder does: open the application’s resource fork, access its BNDL resource to get the resource ID for the icon suite for type APPL, and then use PlotIconID as I suggested before. But the desktop DB is the “right”...
Actually you can save a step with PlotIconMethod. This code works for me. (‘Check’ is my own macro to shout if the argument is nonzero, you can replace with your own.)
pascal OSErr MakeIconCache (Handle *theCache, ProcPtr GetAnIcon, Ptr
yourDataPtr ) = {0x303C, 0x0604, 0xABC9}...
Here’s how I would do it using the Icon Utilities routines (Inside Macintosh: More Macintosh Toolbox) — there may be a better way to avoid the explicit resource type mapping in my step 1 below:
- call MakeIconCache, passing it a pointer to a custom icon getter function. Icon getters are handed...
By the way, as a general point of coding philosophy, System 7 is a really old dev platform, but it wasn’t awful. If one is writing code and you get stuck and find yourself thinking something like “I need to manually check all the various bit depths of icons that exist for this application vs...
No — again this shouldn’t be necessary if MacOfAllTrades uses the icon utilities I suggested above — but if it’s really necessary, you use TestDeviceAttribute(GetMainDevice(), gdDevType).
If it returns TRUE, the device is set to color — otherwise grayscale.
Oh, you shouldn’t need all this for that.
If you just want to plot an application’s icon in the correct bit depth, the routine to use is PlotIconID. It automatically grabs the right ICN#/icl4/icl8 etc for you, and plots it appropriately given the bit depth.
You can look it up in THINK...