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 09-Sep-2006, 10:29
jafar jafar is offline
New Member
 
Join Date: Aug 2006
Posts: 20
jafar is on a distinguished road
Question

draw in image


hello
i'd like to draw in an image ho is in a box !
haw can i do this ????
what library and function shoud i use ????
can u give me some link to start!
or some example ???
i use windows xp , devcpp , fltk
thank u
  #2  
Old 09-Sep-2006, 22:38
baard baard is offline
New Member
 
Join Date: Sep 2006
Posts: 13
baard is on a distinguished road

Re: draw in image


You can use the following code. In DevC++ project options, add the fltk libraries in the linker option.

CPP / C++ / C Code:
#include <fltk/Widget.h>
#include <fltk/sharedimage.h>
#include <fltk/run.h>
using namespace fltk;

int main(int argc, char **argv) {
  Window *window = new Window(300, 180);
  window->begin();
  Widget *box = new Widget(20, 40, 260, 100);
  box->image(fltk::pngImage::get("yourimage.png"));
 window->end();
  window->show(argc, argv);
  return run();
}
Last edited by LuciWiz : 10-Sep-2006 at 08:45. Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
  #3  
Old 11-Sep-2006, 06:49
jafar jafar is offline
New Member
 
Join Date: Aug 2006
Posts: 20
jafar is on a distinguished road

Re: draw in image


thank u for the answer
but the directory /fltk/ doesnt exist i have just FL and i tray to change the name FL to fltk but it doesnt work
may be the version of fltk
pliease say me what is the version that i shoud install to have the directory "fltk"
and can u give me the link to download
  #4  
Old 12-Sep-2006, 06:47
baard baard is offline
New Member
 
Join Date: Sep 2006
Posts: 13
baard is on a distinguished road

Re: draw in image


It is fltk2. You are using Fltk 1.x.x . Install fltk2. And don't forget to link with the needed libs.
It is also possible in Fltk 1.x.x
  #5  
Old 12-Sep-2006, 07:05
baard baard is offline
New Member
 
Join Date: Sep 2006
Posts: 13
baard is on a distinguished road

Re: draw in image


Ok. I will pos some code for you.
Code:
//Load an Image in a box #include <FL/Fl.H> #include <FL/Fl_Window.H> #include <FL/Fl_GIF_Image.H> #include <FL/Fl_Box.H> static Fl_GIF_Image imagename ("test.gif"); Fl_Window* Win; Fl_Box* abox; int main(int argc, char **argv) { Win = new Fl_Window(640, 480); abox = new Fl_Box(5, 5, 100, 100); abox->image(imagename); Win->show(argc, argv); return Fl::run(); }
Last edited by baard : 12-Sep-2006 at 07:08. Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
 
 

Recent GIDBlogConfiguring iptables for Webmin Servers Index Module by gidnetwork

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
draw in image jafar FLTK Forum 2 19-Sep-2006 10:51
Threads & draw image j2me Java Forum 3 30-Aug-2006 10:55
loading image asal FLTK Forum 5 24-Feb-2006 11:43
GIM gidedit - a fltk fluid resize project cable_guy_67 FLTK Forum 2 01-Jun-2005 15:00
Checking source codes of image, audio and video files onauc C Programming Language 5 26-Feb-2005 21:47

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

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


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