Images in ImageWell/Toolbar

Hey guys,

how Xojo deals with images is a black box for me.

My learnings so far:

  1. Do NOT use SVGs in Toolbars/ImageWells, because Windows (and) possibly Linux can’t handle them properly.
  2. Use PNG/JPG images of the correct size for what you are doing

What I don’t understand:

  1. Toolbar icon size should be 32x32. Do I need different a different size for Retina?
  2. Do I need NSImages (via MBS, MacOSLib or the Retina Kit) for Retina?
  3. What is the purpose of the image formats 1x, 2x, 3x, in Xojo? Is 1x for Non-Retina and 2x for Retina?
  4. Why does an image well always have a white frame around it?

Best regards
Ben

Welcome!

  1. Yes, 32x32 and 64x64.
  2. Not if you’re using 2016r1 or newer. If you’re using an older version of Xojo, check out RetinaKit.
  3. Yes. 3x is only on Windows at the moment, but it’s good to be prepared.
  4. On Mac yes, that’s how it looks. You can use a Canvas and set it’s Background property to simply place an image.

Thanks Tim!

So:

  1. no ImageWells anymore, just Canvas with background property.
  2. Png Files in the right dimensions always, 1x, 2x, 3x.

ImageWell is to indicate to your user that this area is editable by them.
Display images and accept drops in ImageWell when it’s an image your user is supplying.

If it’s just to show an image on the interface, yes use a Canvas + Background

SVG’s have VERY little OS level support
They’re oddly found in lots of places but not well supported by the various OSes
Most support you find is “one off” in specific apps, browsers etc