Hi Alex,
follow is my need:
using fxruby binding library i''ve got all my application''s
icons to be
embedded inside an .rb file, here is an example:
icon_mgr.rb
class IconMgr
def self.acrobatPng(app)
icon = <<END_OF_STRING
iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAYAAADEtGw7AAAAAXNSR0IArs4c
6QAAAARnQU1BAACxjwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUw
AADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAALEQAACxEBf2RfkQAAAAd0SU1F
B9MIGRQuFTjqcZ4AAAUNSURBVEhLlZRrTJNXGMcxLtEMzT44Uucki8Y4k32b
Ge7DNnVmc2jQwdaZKTFMrAoqdsBwIChW8QKyxDCJvsZhRIcDA0hFBBFQhF6o
vV+h0Au90dZS6B1i/jvvazBRSIxNnpz3nJ739z7n//zPExf3Dr/u9evfk23Z
cuHK2rUfvMNrb996NyWFVb1hQ1E2i7Xu7bvfYUdbaupHV5OTC08lJa1462sA
5oXOUrzYqcu8SBkJ8hypvMFEiKwFjlbyQoXnebGSCl6otLJC9ttelZpbXB2r
usiLVJD/TlbwAifKeGFubgn52LxXHwSbPX+KW44RNhe63QXQZfwJw95iEiUw
ckpgyiqCNb8UzpOVGCu/BHvKNqhLz8JVWQUHrxy2/OPw7M/F5P686OLFi5e8
Bo79Xo7Wo+dRc+1f1Nc1415LOx51PoFYJIVGpYVx0AiryQqHzQFHaioMag3G
nGOwk7mFrFuEEgSy86OLFi1KeD1jAm4vOIebtXfQ2Hgf7e3d6O8fgIpAh4ZG
MDpqh9vtgd/rhXvdl3C1tSEQCGJ83E/WvXAotQjmlc0Gx3LO4WHuGdTVNeHe
vQ709PRDLldjcGgYVusoA52YmEBQJIKmqAjuzExEQmFEIlGyPgnv4DBCvKq5
wCfRVXgW9fUt6Ojohkg8AK3WgJFhM+x2B3y+cYTDYTxPS4Neo8F4QwP8tbWI
RaNkPYIJsxXhqpq5wCXoLS1Hc/N9PHzYg4EBCQHrMTJihtPpYrKNjI5iiM0m
EgQwNTWFMZJ5gHwgGokgYHMicuPOHBpzciE8fQGtrZ3oJEUTCp9BrdZhmGQ8
A/aR4yvlckxPTxPwNKI+Hxx5eRjfsQP+Xenw/rrzhXXjRoE2ObmC3Mz34xi7
7T2CZxcuMdAnTwQkYxmUKg1TOLvdCZ9SDUN2NiYVCvhJpq6CAhj5fCilUshI
aA8ehHnTphc1SUmnti1d+s1fCxYcZMDh/YVQ/H0NfX1iJluJRA4FKZ5ePwQz
ydpFLKaquw2XywWP283IESES0PpOTgbgJXscV6/GPo6P/zYnPn7TsYULExlw
8MBxaKhaSKVKEiomFDIVjP9ch/liFcTFJbDZ7PD7iTOCQYSII+iRnns8Xjh1
BvirL8/WOHjgBIau34ZGo2e8q1BoYObm4unNOui3/whhnxAWi43oPcZYz+N5
/tK/ZG612mCRKeA7f2Y2OMA5BsutBhiNJub4xuYWdFVfgSllOx7UNzKF1OuN
GDaaYRqxwEzsZSI3jt5vMBihF4jgLj42B/iHnXA03mUyootlau+EPn03Whua
GHnkcg1zCiW5YWq1npxskBnpuZRIJn/0GM7cvDfAcez5E19shLOllRTHzYTV
amdkUasNDJDWXCJRQCyWQUT6x8woEEiYggv4bbBnHXoTHDc/+PlXcDXxX4Ed
DhfxsAU63eDLrAiYBtKQx48F6O7qQ1fXU2LPXtJXevDovyaMZnJmg8OffQ03
0XUmY7o4dOOhfUxnLiPHFQql6O0VMV6/39YFPr+D3NQHpGm1gl9zC+b03bOl
iH76CyJbtyOUtQ+TOfvgP5wBZ9oe6LbmQ7vlD8iTj0C6mQvxd9kQfp+F/s07
8XTrz+j/KR0D6RyoOIdgTGO/Dqa7/uklq8u4CYlUDiuROpy4nMpasZTax1pO
ZbJWU5kJq6iMhJVUBnnOYJGReV5GYjmVsewTKnPFSoqzajW1Z82aatKPP5zp
x/8DfhpdyC9Tf7MAAAAASUVORK5CYIIEND_OF_STRING
return FXPNGIcon.new(app, icon.unpack(''m'').to_s)
end
...
...
end
when i package the application using rubyscript2exe i need to provide my app
with a path to load icons, while using the above solution i don''t need
it
anymore.
Is it possible to achieve the same result with wxruby2?
thank you.
fabio.
On 8/6/07, Alex Fenton <alex at pressure.to>
wrote:>
> Hi Fabio
>
> Fabio Petrucci wrote:
> > is there any way to load a base64 converted image using classes such
> > as Image or Bitmap?
> I would use Ruby''s base64 module (in the standard library) to
decode the
> image to data, then save it to a temporary file to open using Wx::Image
> or Bitmap.
>
> WxWidgets has constructors for Image and Bitmap that are support
> creating images from a blob of xpm data, or from a stream, but these
> aren''t in wxRuby. I can probably add them if anyone thinks they
would be
> useful.
>
> alex
>
>
> _______________________________________________
> wxruby-users mailing list
> wxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/wxruby-users/attachments/20070806/d60caade/attachment.html