java - Codename One createMaterial icon size for a command -
i want use material fontimage command in toolbar. works, don't know how change size of image. can't find way style since has no style option. found out can change fontsize this:
style.setfont(font.createsystemfont(font.face_system, font.style_plain, font.size_large)); fontimage.creatematerial(fontimage.material_settings, style);
but how change example pixels?
the size determined style in theme.
although can change height using derive:
style.setfont(font.createsystemfont(font.face_system, font.style_plain, font.size_large).derive(fontheight, font.style_plain)); fontimage.creatematerial(fontimage.material_settings, style);
you can set size in pixels using:
fontimage icon = fontimage.createfixed("" + fontimage.material_settings, fontimage.getmaterialdesignfont(), colorrgb, widthpixels, heightpixels);
but best way set using:
fontimage.setmaterialicon(mycomponent, fontimage.material_settings);
this best approach because icon derive style component (font size, foreground color etc.) means don't need work , offhand style customization implicitly applied.
Comments
Post a Comment