From: Ian S. <ian...@st...> - 2004-03-25 09:12:10
|
I don't know about the GUI code, but the vil/vil1 code looks ok (apart from the fact that you don't appear to have any reason to convert it from a vil1 to vil image and then back again.) Can you reproduce the problem in a smaller example? Does it depend on the type of image file you use? To help you solve this problem, we really need to know where error is raised. A whole stack trace would be useful for this. More details such as a description of the error, the platform/GUI toolkit you are using, compiler name and version, are also often useful when tracking down bugs. Ian. > -----Original Message----- > From: vxl...@li... > [mailto:vxl...@li...]On Behalf Of "Van > Genechten, Björn" > Sent: Thursday, March 25, 2004 7:19 AM > To: 'vxl...@li...' > Subject: [Vxl-users] Converting a vil1 image to vil > > > > Hello, I am trying to convert a vil1 image to vil using this > code to try > it out. Everything compiles fine but I get an application error on > running. > Could someone tell me what's wrong? > > Thanks, > Bjorn > > > // ------------------------------------------------------------ > void convert_vil1_to_vil() > // ------------------------------------------------------------ > { > vcl_string loadfile_Image_1("test.jpg"); > vcl_string* file_value_1 = &loadfile_Image_1; > vcl_string regexp; > > // get the filename to be loaded > vgui_dialog file_open_dialog("file_open_dialog"); > file_open_dialog.inline_file("file browser", regexp, > *file_value_1); > if (!file_open_dialog.ask()) return; > > vil1_image image = vil1_load(file_value_1->c_str()); > vil1_memory_image_of<vxl_byte> img(vil1_image_as_byte(image)); > > // conversion > vil_image_view<vxl_byte> img1 = > vil1_to_vil_image_view(img); > vil1_memory_image_of<vxl_byte> > img2(vil1_from_vil_image_view(img1)); > > // put the image on the screen > vgui_image_tableau_new image_tableau(img2); > vgui_viewer2D_tableau_new viewer2D_tableau(image_tableau); > vgui_grid_tableau_new grid_tableau(1,1); > grid_tableau->add_next(viewer2D_tableau); > > // replace the previous shell > vgui_tableau_sptr PrevTableau = shell->get_child(2); > shell->remove(PrevTableau) ; > shell->add(grid_tableau); > shell->post_redraw(); > } > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click > _______________________________________________ > Vxl-users mailing list > Vxl...@li... > https://lists.sourceforge.net/lists/listinfo/vxl-users > |