Posted: Sat Sep 24, 2005 1:53 pm Post subject: View & Extract icons from AIF file
This code snippet enables you to view icons in AIF file and extract them to single MBM files.
It will always show all 4 icon sizes, as you see them in the system screen, using zoom function!
If some icon sizes are missing in AIF file, they will be extrapolated.
You can extract all icons at once or single icons (with or without masks).
Saved MBM files are named like File.mbm_icon16, File.mbm_icon24mask etc...
PROC AifExtract:(fileName$)
LOCAL MBM$(255), icon$(7), save_all%, p%(6)
BUSY "Wait..."
MBM$=PARSE$(".", fileName$, p%()) + "mbm"
dINIT "Extract icon and save as MBM file"
dCHOICE choice%,"Icon","All icons,16x16,16x16mask,24x24,24x24mask,32x32,32x32mask,48x48,48x48mask"
dFILE MBM$, "Name,Folder,Disk", KDFileEditBox% or KDFileEditorQueryExisting% or KDFileSelectorWithSystem%
dBUTTONS "Cancel", kKEyEsc% OR $100, "Ok", kKeyEnter% OR $100
BUSY OFF
IF 0 = DIALOG
RETURN
ENDIF
PROC Loop:(fileName$)
GLOBAL choice%
LOCAL Ev&(16)
DO
BUSY "Press “X” to extract icon, “Esc” to exit", 2
GETEVENT32 Ev&()
IF Ev&(kEvAType%) = ASC("x")
AifExtract:(fileName$)
ELSEIF Ev&(1) = kKeyEsc%
BUSY OFF
gIPRINT "Closing"+CHR$(133), 2
PAUSE -20
BREAK
ENDIF
UNTIL 0
ENDP
PROC ErrorHandler:(er$, err%)
IF err% < 0
BUSY OFF
ALERT (er$, "", "", "")
ENDIF
ENDP
Last edited by Edo on Sat Sep 24, 2005 9:56 pm; edited 2 times in total
Just a question:
Are we allowed to use your codes in our own program and to share this app, then? (Of course, I would say that it's from you, Edo )
Greets, Jonas
Of course you are allowed to use it, Jonas! That's why it's published here, to help you do something on your own
by following the example or just to change it in order to better suit your need.
Well, as usual, it's up to good manners to mention the source of the code you used
Edo, you're great. So we can expect new programs en utilities written with you're help. It's good to realize epoc isn't dead. Unfortunately I can't program myself and don't have the time to learn it, so I'm depended on people like you (with thanks ) _________________ Henk-Jan Bezemer
Member of the Dutch Psiongroup
http://www.pdatotaal.info/portal.php?page=psion
Last edited by henk-jan on Mon Sep 26, 2005 1:53 pm; edited 1 time in total
Edo, you're great. So we can expect new programs en utilities written we you're help. It's good to realize epoc isn't dead. Unfortunately I can't program myself and don't have the time to learn it, so I'm depended on people like you (with thanks )
Thanks Henk-Jan,
these code snippets are not just samples. If you paste them into OPL Editor
and translate, you actually get little utils which you can immediately use, without any intervention
Unfortunately I can't program myself, so I'm depended on people like you
Edo that's the same for me.
Edo wrote:
these code snippets are not just samples. If you paste them into OPL Editor
and translate, you actually get little utils which you can immediately use, without any intervention
Finding bug is easy for me, but programming.....
I did what you wrote, but after translation my nB says "Record too large"
What did I wrong? _________________ Regards,
Unfortunately I can't program myself, so I'm depended on people like you
Edo that's the same for me.
It's never late to start writing some code on your own. And, it's fun
kees vd straten wrote:
Edo wrote:
these code snippets are not just samples. If you paste them into OPL Editor
and translate, you actually get little utils which you can immediately use, without any intervention
Finding bug is easy for me, but programming.....
I did what you wrote, but after translation my nB says "Record too large"
What did I wrong?
I don't know, since it goes OK for me!
Anyone else has problems translating/running this applet?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum