Author Topic: toolbox bitmaps  (Read 7002 times)

Adam@Schneider

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
toolbox bitmaps
« on: November 17, 2014, 08:29:14 pm »
For an MDG, I have tried converting some icon files to bitmaps to be set as toolbox icon images. It doesn't seem to matter what format the bitmaps are in, EA tells me that I must use a 16x16 bitmap, I cant seem to get it to accept anything.

I'm using ImageMagick for the conversion and have tried a heap of different option combinations, with no luck. If I manually specify the image the base64 encoding in the UML profile comes out as a block of 'A'. I've even tried gimp and ms paint - I've gone through all permutations of BMP in paint with no luck.

What is the bitmap type that EA accepts? bmp2,3,4? how many colours? what depth etc?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: toolbox bitmaps
« Reply #1 on: November 17, 2014, 11:19:27 pm »
I remember this has been posted here by one of the Sparxians. Try a search while you wait  ;)

q.

Adam@Schneider

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: toolbox bitmaps
« Reply #2 on: November 18, 2014, 12:30:11 pm »
Thanks, I've searched for bmp, bitmap, icon, image with no luck.

I shouldnt need to create specific toolbox items, I think I have found an issue. I have a stereotype icon in my MDG set with the icon attribute, it is bigger than 16x16, it is being scaled down for the project browser but not the toolbox, it is 'overflowing' into other toolbox icons. Fixing the source image to a 16x16 size means I dont need to set toolbox items.


Jayson

  • EA User
  • **
  • Posts: 363
  • Karma: +1/-0
    • View Profile
Re: toolbox bitmaps
« Reply #4 on: November 19, 2014, 04:27:25 am »
I create my icons using nasty old paint and save them as 24bit colour depth bmp.
This works no problems for me.

Adam@Schneider

  • EA User
  • **
  • Posts: 32
  • Karma: +0/-0
    • View Profile
Re: toolbox bitmaps
« Reply #5 on: November 19, 2014, 12:28:24 pm »
Quote
Found this: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1408556947/3#3, this: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1389627616/5#5 and this: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1380836610/3#3

q.

Thanks, I dont know how the search didnt pick this up.

Anyway I've discovered the toolbox icons are completely unnecessary if you set up your stereotypes correctly. My source images are windows icon files and I'm converting them with imagemagick for use with EA, here are a few tricks in case anyone runs into issues.

To get the same image to work for both toolbox and alternate images via the image manager, set the background colour to 192,192,192 (C0C0C0) and then set transparency.

The icon attribute in your UML profile must be a 16x16 image, EA scales anything you give it for use in the project browser, but it does not scale them for toolbox icons. When I used a 48x48 image the item with that image in the toolbox showed a portion of the unscaled image, the toolbox items below it showed different portions of that image. Get this right and you don't need to specifically set toolbox images.

For reference, this is how I convert icon files to png files.

To figure out what an icon contains:
identify Source.ico

This will give you a list of each image and its details stored in the icon.
Source.ico[0] ICO 16x16 16x16+0+0 8-bit sRGB 26.7KB 0.000u 0:00.002
Source.ico[1] ICO 24x24 24x24+0+0 8-bit sRGB 26.7KB 0.000u 0:00.009
Source.ico[2] ICO 32x32 32x32+0+0 8-bit sRGB 26.7KB 0.000u 0:00.016
Source.ico[3] ICO 48x48 48x48+0+0 8-bit sRGB 26.7KB 0.000u 0:00.022
Source.ico[4] ICO 16x16 16x16+0+0 32-bit sRGB 26.7KB 0.000u 0:00.041
Source.ico[5] ICO 24x24 24x24+0+0 32-bit sRGB 26.7KB 0.000u 0:00.048
Source.ico[6] ICO 32x32 32x32+0+0 32-bit sRGB 26.7KB 0.000u 0:00.053
Source.ico[7] ICO 48x48 48x48+0+0 32-bit sRGB 26.7KB 0.000u 0:00.059

Then:
convert -background #C0C0C0 -alpha Background Source.ico[4] Dest.16x16x32.png
convert -background #C0C0C0 -alpha Background Source.ico[7] Dest.48x48x32.png

The first will generate a small image for your icon attribute to be used for the toolbox and the project browser. The second is the biggest for use as an alternate image in the image manager, for your stereotype icons using the _image shapescript.

Note that I still haven't managed to get transparency to work for the stereotype icons, they appear with the grey background and ignore the image transparency. If this bothers you, for the second image you can set the background colour to the colour you are going to set your element to and then it looks transparent but really isnt.

If you have a lot to convert, you can run a mass conversion, then go through and delete the resolutions you dont want (generally I keep the 16x16 and then biggest which can then be scaled down).

convert -background #C0C0C0 -alpha Background *.ico -set filename:f %t.%wx%hx%z.png +adjoin png:%[filename:f]


qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +396/-301
  • I'm no guru at all
    • View Profile
Re: toolbox bitmaps
« Reply #6 on: November 19, 2014, 09:30:23 pm »
Quote
Thanks, I dont know how the search didnt pick this up.
Likely because the Sparxian did put a lot of effort in making the search unusable. First there are THREE search possibilities on top of this very page. Only one will bring you to the right place. Being there (using the button top left) you need to extend the search to ALL.

q.