# Images in FXRuby

**URL:** <https://www.ruby-forum.com/t/images-in-fxruby/82046>\
**Category:** Ruby\
**Created:** [January 17, 2007, 12:54am UTC](https://www.ruby-forum.com/t/images-in-fxruby/82046 "2007-01-17T00:54:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dorelal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/3da27b/32.png) [@dorelal](https://www.ruby-forum.com/u/dorelal)\
**Post date:** [January 17, 2007, 12:54am UTC](https://www.ruby-forum.com/t/images-in-fxruby/82046/1 "2007-01-17T00:54:03Z")

</div>

I’m new to FXRuby, and I’m having a problem with displaying images. I’m  
simply trying to display an image in a vertical scroll window, with the  
end result being a program that shows multiple images with vertical  
scrolling. I can get button icons to work just fine. I have tried  
using both FXImageView and FXImageFrame. What am I doing wrong? A  
sample of my code is:

require ‘fox16’  
include Fox  
theApp = FXApp.new

imageFile = File.open(“gm.jpg”, “rb”)  
theMainWindow = FXMainWindow.new(theApp, “Hello”, nil, nil, DECOR\_ALL,  
400, 400)  
firstWindow = FXScrollArea.new(theMainWindow,  
VSCROLLER\_ALWAYS|LAYOUT\_FILL\_X|LAYOUT\_FILL\_Y)  
image = FXJPGIcon.new(theApp, imageFile.read)  
imageView = FXImageView.new(firstWindow, image)

theApp.create  
theMainWindow.show  
theApp.run
