DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Link: http://www.fltk.org/str.php?L2327
Version: 2.0-current


when i load a image with:

Image* img = SharedImage::get( "test_image.bmp" );

i get wrong width and height calling img->w() and img->h()

but if i do this:

Image* img = SharedImage::get( "test_image.bmp" );
int w,h;
img->_measure(w,h);

now when i call img->w() and img->h() i get right values.

i think this may be an initialization problem...


Link: http://www.fltk.org/str.php?L2327
Version: 2.0-current
#include <fltk/run.h>
#include <fltk/Window.h>
#include <fltk/Widget.h>
#include <fltk/Slider.h>
#include <fltk/math.h>
#include <fltk/draw.h>
#include <fltk/Image.h>
#include <fltk/string.h> // for snprintf
#include <fltk/events.h>

#include <fltk/SharedImage.h>
#include <fltk/ask.h>



using namespace fltk;

int main(int argc, char **argv) {
  
  Image* img = SharedImage::get( "test_image.bmp" );
  int w,h;
  img->_measure(w,h); //withou this img->w() and img->h() dont work
  
  char buf[64];
  sprintf(buf, "%d %d",img->w(),img->h());
  fltk::alert(buf);
  
  return 0;
}
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to