I am still pretty new to wxwidgets and I am trying to learn as fast as
possible.
Currently I am using wxruby and I want to build an application that
would display all png images that are in its current directory as
thumbnails and once a user clicks on one of these thumbnails another
application would launch displaying a better resolution or larger
version of the thumbnail image.
I have been looking at the Image, ImageList and PNGHandler classes, but
I cannot seem to get anything to work. I cannot even declare a handler.
At this point I just want png thumbnails to display in a window.
I am still pretty new to wxwidgets and I am trying to learn as fast as
possible.
A good place to start is among the samples that come with wxruby and
wxruby2. These give short illustrations of how to use a lot of the
classes.
I have been looking at the Image, ImageList and PNGHandler classes, but
I cannot seem to get anything to work. I cannot even declare a handler.
There is a sample that shows how to load a PNG image. Something like:
class MyFrame < Wx::Frame
def initialize(title)
super(nil, -1, title)
evt_paint { on_paint }
image = Wx::Image.new(‘paperclip.png’) # load the image from the
file @bitmap = Wx::Bitmap.new(image) # convert it to a bitmap, ready for
drawing with
end
def on_paint
paint do | dc |
dc.clear
dc.draw_bitmap(@bitmap, 0, 0, false) # draw the
end
end
end
At this point I just want png thumbnails to display in a window.