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 05-Apr-2005, 11:27
maveganzones's Avatar
maveganzones maveganzones is offline
New Member
 
Join Date: Mar 2005
Location: San Sebastian (Spain)
Posts: 12
maveganzones is on a distinguished road

Display filesystem to load a file and drawing an image


Hi again, i had two new problems:

1. I want to draw a jpeg file in a box. How can i do it? Im doing this but it dosn't work.

CPP / C++ / C Code:
void IU_em::draw() {
  // Tengo guardada la imagen en una estructura >Ipl_Image de la que extraigo data, size y step.
  fl_draw_image((uchar*)data, imagen_box->x(), imagen_box->y(), size.width, size.height, 3, step);
  imagen_box->redraw();
}

2. How can i get a filesystem display window so i can give the choose of loading a file? Just like the browse... usually window.

Thanks
  #2  
Old 05-Apr-2005, 14:47
cable_guy_67's Avatar
cable_guy_67 cable_guy_67 is offline
Senior Member
 
Join Date: Oct 2004
Location: Nescopeck, PA
Posts: 1,109
cable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the roughcable_guy_67 is a jewel in the rough
Quote:
Originally Posted by maveganzones
Hi again, i had two new problems:

1. I want to draw a jpeg file in a box. How can i do it? Im doing this but it dosn't work.

CPP / C++ / C Code:
void IU_em::draw() {
  // Tengo guardada la imagen en una estructura >Ipl_Image de la que extraigo data, size y step.
  fl_draw_image((uchar*)data, imagen_box->x(), imagen_box->y(), size.width, size.height, 3, step);
  imagen_box->redraw();
}

2. How can i get a filesystem display window so i can give the choose of loading a file? Just like the browse... usually window.

Thanks

Hello and Welcome to GIDForums™ maveganzones. A few bits of information are needed.
  • What version of FLTK are you working with?
  • Show a more of the code so we can play along at home.

Do you just want to show random pictures or some that you have in mind? We could whip up something like the attached image without much trouble. I have a dir full of playing cards that will work well. That way the dimentions are fixed and it will be easier to show the example.

To get the image off disk you could use Fl_File_Chooser.

Mark
Attached Images
File Type: png screen_shot.png (8.2 KB, 68 views)
__________________
"Opportunity is missed by most people because it comes dressed in overalls and looks like work."
--Thomas Alva Edison
"Those who would give up essential liberty to purchase a little temporary safety, deserve neither liberty nor safety."
--Benjamin Franklin
"A happy person is not a person in a certain set of circumstances, but rather a person with a certain set of attitudes."
--Hugh Downs
  #3  
Old 06-Apr-2005, 11:29
maveganzones's Avatar
maveganzones maveganzones is offline
New Member
 
Join Date: Mar 2005
Location: San Sebastian (Spain)
Posts: 12
maveganzones is on a distinguished road
Hi Cable_guy and thanks for the responses.

I have solved the problem about showing images in a box, but i dont know how the FL_File_Browser works. What I want its to load an image from a file of the user choose, can you help me with an example, please? I would thank you a lot.

Greetings
  #4  
Old 07-Apr-2005, 12:15
maveganzones's Avatar
maveganzones maveganzones is offline
New Member
 
Join Date: Mar 2005
Location: San Sebastian (Spain)
Posts: 12
maveganzones is on a distinguished road
I have fixed it with the Fl_File_Chooser widget. Im going to post a thread explaining how to use the Fl_File_Chooser widget and making some questions about it.

Thanks
 
 

Recent GIDBlogToyota - 2008 November Promotion by Nihal

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
Airport Log program using 3D linked List : problem reading from file batrsau C Programming Language 11 29-Feb-2008 08:44
CD burner wont burn!! robertli55 Computer Hardware Forum 1 18-Jun-2004 11:53
Yet another CD burner problem: Lite-On LSC-24082K Erwin Computer Hardware Forum 1 22-May-2004 12:28
Re: Programming Techniques WaltP C Programming Language 0 10-Mar-2004 00:56

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

All times are GMT -6. The time now is 07:21.


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