GIDForums  

Go Back   GIDForums > Computer Programming Forums > FLTK Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 20-Oct-2009, 10:07
sarrowoo sarrowoo is offline
New Member
 
Join Date: Oct 2009
Posts: 1
sarrowoo is on a distinguished road

Showing jpeg, png, gif, etc images


Hey all,

I'm using fltk 1.3 and ms visual studio 2005.

I'm trying to get a simple image viewer going and am having trouble. I am trying to get erco's sample code to work for a jump off point but no dice. I have all the necessary libraries linked and i dont get any complier or linker errors but the program only displays a window with a gray box.

Here is the code I'm using:

CPP / C++ / C Code:
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Shared_Image.H>
#include <FL/Fl_JPEG_Image.H>
#include <FL/Fl_Box.H>

int main() {
    fl_register_images();                       // initialize image lib
    Fl_Window     win(720,486);                 // make a window
    Fl_Box        box(10,10,720-20,486-20);     // widget that will contain image
    Fl_JPEG_Image jpg("browns.jpg");      // load jpeg image into ram
    box.image(jpg);                             // attach jpg image to box
    win.show();
    return(Fl::run());
} 


I have tried all different ways to write the path for the actual file browns.jpg even going so far as using the absolute path and still nothing but a gray box. This is part of a larger project but I'm just trying to get erco's example to work in order to figure out how it all works. If there are any questions you guys have in order to get better clarification just let me know.

Thanks
Last edited by admin : 20-Oct-2009 at 19:06. Reason: Please insert your example C/C++ codes between [CPP] and [/CPP] tags
 
 

Recent GIDBlogOnce again, no time for hobbies by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading wrong images. Sujith MS Visual C++ / MFC Forum 0 08-May-2007 05:48
Jpeg DPI resolution jvpic C++ Forum 2 14-Aug-2006 01:35
Jpeg Grabber using CIMAGE babu_gi C++ Forum 5 10-Jan-2005 01:15
Problem Showing Images !!!! eRIC MySQL / PHP Forum 0 05-May-2004 23:33
Why are my images distorted? rhino1616 Graphics Forum 0 27-Jun-2003 10:30

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:47.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.