Sample Code- Image Viewer

I have uploaded a REALLY simple image viewer that I wrote as a first JUCE “etude”.
Don’t hold your breath! :lol:
I am only putting it here only for the slight chance it might save you time on your next project.

There’s a screenshot inside, so if you can’t compile it, at least you can see what it can look like.

See main.cpp for all sorts of caveats

I have no intention to develop this further, but comments are welcome.

Thanks, look nice!

Few comments:

  • You should imclude juce with #include <juce.h> instead of a relative path, and tell your compiler where juce is…
  • there are few warnings about some conversion
  • I tried to look at my picture folder and got an exception here

void ImageCache::addImageToCache (Image* const image,
const int hashCode)
jassert (image != 0);

maybe you patched the juce source (from your other post) and we don’t have this patch?

Thanks for the comments!

  • You can ignore the warnings, or you can just type cast the ints to floats in drawLine

  • As for not showing pictures… Are these are jpegs coming from a digital camera? If so, you may want to look in here for a problem and its fix.

Let me know

If I apply the patch to juce jpeg code then it works…

One more comment, why don’t you use DialogWindow for the main window so it will be moveable, etc.?