[exerb-eng:0053] Re: Is there a way to change the Icon?

Back to archive index

Yuya Kato yuya****@katod*****
Mon May 17 01:21:13 JST 2004


Hi Rich,

On Fri, 14 May 2004 07:19:51 -0600
Rich <rich****@lithi*****> wrote:

> Does anyone know how to change the icon for my exe?
If you using Exerb 3.0.0 or later, you can change
an icon by the following code.

  require 'exerb/recipe'
  require 'exerb/executable'

  icon16 = Exerb::Resource::Icon.new_from_file('your_icon.ico', 16, 16, 4) # 16x16 4bit-color
  icon32 = Exerb::Resource::Icon.new_from_file('your_icon.ico', 32, 32, 4) # 32x32 4bit-color
  group_icon = Exerb::Resource::GroupIcon.new
  group_icon.add(1, icon16)
  group_icon.add(2, icon32)

  recipe     = Exerb::Recipe.new_from_file('your_recipe.exr')
  executable = Exerb::Executable.new_from_file('../data/exerb/ruby181g.exc')
  executable.rsrc.add_archive(recipe.archive)
  executable.rsrc.add_icon(1, icon16)
  executable.rsrc.add_icon(2, icon32)
  executable.rsrc.add_group_icon(100, group_icon) # No.100 is main icon
  executable.write_to_file('your_exe.exe')

====== Yuya Kato ======
E-Mail yuya****@katod*****
   Web http://nuance.cc/
i-mode http://nuance.cc/i/




More information about the exerb-english mailing list
Back to archive index