Karrtik Iyer
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 }
}
}
}
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 itI 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
ASKER