[wxruby-users] wxRuby error: Image file is not of type 9

Alex Fenton alex at pressure.to
Sat Oct 18 10:45:58 EDT 2008


Omar Hernandez wrote:
> @toolBarPrincipal=create_tool_bar(TB_HORIZONTAL | NO_BORDER | TB_FLAT |
> TB_TEXT )
> @toolBarPrincipal.add_tool(-1, 'Bonzai2',
> Bitmap.new("C:/rubyCode/icons/bonsai.ico"))

Try adding the type argument to tell wxRuby what type of image file 
you're loading from

Wx::Bitmap.new("/path/to/icon.ico", Wx::BITMAP_TYPE_ICO)

See the Wx::Bitmap documentation for a list of supported types. For 
cross-platform use, I'd recommend using PNG over ICO or BMP

hth
alex


More information about the wxruby-users mailing list