JavaFX Fontawesomefx - main app icon - intellij-idea

I am trying to set up my main app icon using Fontawesomefx:
I'm using IntelliJ 2016 and I have imported the Maven libraries for Fontawesomefx 8.9 and Controlsfx 8.40.12 library (as it was stated it helps Fontawesomefx).
I am tying to get this very simple thing working:
I tried to cast it into Image, I tried to convert from Text to Image, I tried other types of casting and conversion yet unsuccessful so far.
Some aditional info:
FontAwesomeIconView extends GlyphIcon<FontAwesomeIcon> //Fontawesome lib
GlyphIcon<T extends Enum<T> & GlyphIcons> extends Text //Fontawesome lib
Text extends Shape //Java lib
Shape extends Node //Java lib
There are plenty links setting up an icon/text/label inside the app, but I couldn't find anything which sets the main app icon.
Any links, any help is much apreciated!

I don't think you will be able to do this directly.
FontAwesome is a set of Unicode characters in the private use area. When you use FontAwesomeFX to create an icon what you actually get is a Text node containing a single unicode character.
The application toolbar icon is set on the Stage as a list of Image objects (you can have icons of multiple sizes). An image must be a GIF, PNG, BMP or JPEG.
You would need to convert the Text node into an Image node to achieve what you want. You could just write a one-off app to render the icon you want into a label on a panel, screenshot that, and save it into a PNG resource that you then use as your app icon.
Or you could load the icon into a node, and use the snapshot() method to create an image from the rendered representation.

Related

ReacNative: requireNativeComponent:"CKCameraManager" was not found in the UIManager

I want to open Camer by using the below npm package, but it is producing this error.
https://www.npmjs.com/package/react-native-camera-kit
import {CameraScreen} from 'react-native-camera-kit';
<CameraScreen
// Barcode props
scanBarcode={true}
onReadCode={(event) => Alert.alert('QR code found')} // optional
showFrame={true}
laserColor="red"
frameColor="white"
/>
I had the same issue. It's an issue with the import in the package itself. Go to CameraScreen.tsx file either by exploring the node modules folder manually or just Ctrl + Left Click on the class CameraScreen in your code. In there, scroll to top and look at the imports. There will be a red line (depends on your code editor) under the Camera import (as shown in the attached image). Just change it to ./Camera.android or ./Camera.ios depending on the platform you're developing for. Solved my issue.
Image or problematic code

Titanium - How to use svg files for fontawesome?

I'm using this widget com.mattmcfarland.fontawesome for fontawesome, but I need to use my Svg files. It's possible by using this widget, or there is other way? and how ?
Solution 1:
There is Ti.SVGView (https://github.com/caffeinalab/Ti.SvgView) and an example at https://github.com/icecandy/TitaniumRenderSVGIconsExample on how to use it. But you need to fork and recompile it if you want to use it with Ti 7.
With the fontawesome Widget you can just use the font. The widget only translates the names to the utf codes, so you don't really need it when you type the codes (e.g. \uf104) into the label.text property.
Solution 2:
You can translate your SVG into a font with e.g. https://icomoon.io/app/ and use it as a normal font. The you just set the font-family to this font and use the codes you asign in icomoon to display your icons

How to programmatically get images commonly used in Eclipse Plug-ins

What are the places to look for if a plug-in wishes to re-use images that are defined by other plug-ins.
For example, where to look for if a plug-in needed the 'Terminate' icon, defined somewhere in the debug plug-in.
Now and then I have been searching for images and though it would be useful to list the locations of commonly used images in one place.
Some of the platform plug-ins make (some of) their images available though ImageDescriptors. Unfortunately all in a slightly different way.
Platform UI - org.eclipse.ui
This plug-in defines images for public use in ISharedImages. To obtain an image descriptor, query the workbench's image registry like this:
PlatformUI.getWorkbench().getSharedImages().getImage( ISharedImages.IMG_OBJ_FILE );
IDE - org.eclipse.ui.ide
The IDE plug-in adds some more images to the workbench image registry and lists the registered names in IDE.ISharedImages.
To obtain an image descriptor, also query the workbench's image registry like this:
PlatformUI.getWorkbench().getSharedImages().getImage( IDE.ISharedImages.IMG_OBJ_PROJECT );
Debug - org.eclipse.ui.debug
The debug plug-in defines shared images in IDebugUIConstants, image name constants start with IMG_. They can be access through the DebugUITools utility class.
For example:
DebugUITools.getImageDescriptor( IDebugUIConstants.IMG_ACT_RUN );
Compare - org.eclipse.compare
The compare plug-in defines ImageDescritpors for Next and Previous images directly in CompareUI.
For example:
ImageDescriptor next = CompareUI.DESC_DTOOL_NEXT;
Team - org.eclipse.team.ui
The team plug-in as well uses a ISharedImage interface to declare overlay images to decorate modified, conflicting, etc. resources.
The image descriptors can be obtained through the TeamImages class:
ImageDescriptor imageDescriptor = TeamImages.getImageDescriptor( ISharedImages.IMG_DIRTY_OVR );
JDT - org.eclipse.jdt.ui
JDT aligns with the workbench when providing images. Its ISharedImages interface defines the registered names and JavaUI.getSharedImages() allows to obtain the respective image descrptors.
Directly Accessing Images
AbstractUIPlugin has a static helper method to get a descriptor of an image in an arbitrary plug-in.
ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin( "the.bundle.id", "/icons/sample-image.png" );
Warning: Loading images in this way is risky and should generally be avoided. Image locations are not part of a plug-ins API and a plug-in author may choose to delete or move the image which will break your code. If you need proof that this actually happens, have a look at this post.
If you need an image from a plug-in that doesn't make it available through its API, you should prefer to place a copy of that image within your plug-in.

QML Component Screen Rendering

Is it possible to capture the screen rendering of a QML Component and save it to an image file? I would like to drive a Component through several different states, and capture its visual appearance for documentation purposes, without having to do screen/window captures.
Yes, you could set up your state transitions to call QWidget::grab then save it to a file through QPixmap.
If you need an example of how to set up your code to call QWidget::grab take a look at this answer: How to take ScreenShot Qt/QML
It's important to replace QPixmap::grabWidget with QWidget::grab because QPixmap::grabWidget is now obsolete. Once you have the QPixmap from QWidget::grab follow the documentation in QPixmap to save to the format you'd like such as jpeg, png, gif.
Here are some links to the documentation to help you out.
QWidget::grab
QPixmap
QPixmap::save
With Qt 5.4 it is now made easier with grabToImage - this method resides on all QQuickItem objects.
EDIT
It's worth mentioning that the item you call grabToImage() on must be a child of a top-level Window item container

AIR custom transparent chrome problem Flash Builder 4.5.1

I'm re-creating an AIR app with FB 4.5.1. (I've started from scratch, having had trouble importing FB 4 projects).
In the app.xml I have the following defined:
<systemChrome>none</systemChrome>
<transparent>true</transparent>
Having done this I still get a full window with titlebar, min, max, and close buttons.
what gives?
I believe you need to create a skin for the application.
This appears in Adobe's forum, and includes an FXP of a functional transparent app:
http://forums.adobe.com/thread/476699
Setting systemChrome & transparency along with "backgroundAlpha" to "0" would have helped in Flex 3.
But, skinning of components in Flex 4 i.e Spark components is little different and completely customizable.
Following are the steps you need to do make the window transparent.
Set systemChrome to "none" in the XML configuration file
Set transparent to "true" in the XML configuration file
Copy the skin code from <SDK_FOLDER>\frameworks\projects\airframework\src\spark\skins\spark\S parkChromeWindowedApplicationSkin.mxml and paste in a new MXML file.
Set the "alpha" property of "backgroundRect" object inside the skin file to "0".
Assign the newly created skin as the "skinClass" for "s:WindowedApplication" object
Please import the attached FXP file using "File->Import Flex Project" menu and have a look at the code to make it much more clear.
First, I discovered it is easier to interact with app.XML by opening it via "Open With -> Text Editor".
Second, and this is really embarrassing, I had simply failed to remove the comments bracketing
was:
<!-- <systemChrome>none</systemChrome> -->
<!--<transparent>true</transparent>-->
should have been:
<systemChrome>none</systemChrome>
<transparent>true</transparent>
...duh! I knew better, but...
Lastly, for a completely chromeless app, add
showStatusBar="false"
to the app header.
that's it!