Link to home
Start Free TrialLog in
Avatar of Karrtik Iyer
Karrtik IyerFlag for India

asked on

QT | QML | Load EMF file as button image

Hi,
I am building a QT Quick application using QML in which I have an tool bar and tool bar buttons.
For these tool bar buttons I want to set source as an EMF file. (http://whatis.techtarget.com/fileformat/EMF-Enhanced-Windows-Metafile) (https://msdn.microsoft.com/en-us/library/ff548726%28VS.85%29.aspx?f=255&MSPPError=-2147217396)
But it seems that QML is not able to load the EMF file. Any idea if there anyway to get EMF file to be loaded as image source in QML?
Sample source code that I am trying:
ApplicationWindow {
    title: qsTr("Hello World")
    width: 640
    height: 480
    visible: true
    toolBar:ToolBar {
             RowLayout {
               anchors.fill: parent
               ToolButton {
                   iconSource: "open.emf"
               }

               Item { Layout.fillWidth: true }
           }
       }



}
ASKER CERTIFIED SOLUTION
Avatar of sarabande
sarabande
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Karrtik Iyer

ASKER

I agree Sara, but our UI design team who provides us icon, images, etc.. have decided to give these in EMF format and they have suggested us not to convert it, if converted, it would be very straight forward, as I already agreed with you.
our UI design team who provides us icon, images, etc.. have decided to give these in EMF format and they have suggested us not to convert it
I had the same case with a third party design team at my current project. they wanted to give us icons, images and logos in photoshop format as this was their default output. their argumentation was that the pictures would look much better this way. but, actually, when displaying the images with normal windows gdi, all the advantages were lost. worse, if we would have done the conversion at runtime or with a different tool, the results would have been not acceptable cause the images were not optimized for bitmap format when doing it this way. any text in the images would look fuzzy and the colors cannot be mapped properly. so we insisted on getting bitmaps and all was good.

Sara