The following code will display images when targeting html5, but not when targeting windows:
package;
import openfl.display.Sprite;
import openfl.Lib;
import openfl.Assets;
import openfl.display.Shape;
import format.SVG;
import openfl.display.BitmapData;
import openfl.display.Bitmap;
import openfl.utils.Object;
/**
* ...
* @author Rob
*/
class Main extends Sprite
{
public function new()
{
super();
var svgFile = Assets.getText("img/1.svg");
var svg = new SVG(svgFile);
svg.render(graphics, 0, 0);
cacheAsBitmap = true;
}
}
Haxedevelop returns the following error messages (this means nothing to me…):
cl.exe -Iinclude -nologo -Od -DHX_WINDOWS -GR -Zi -Fdobj/msvc16-debug-ncxp/vc.pdb -Oy- -c -EHs -GS- -arch:SSE -IC:/HaxeToolkit/haxe/cpp/hxcpp/3,2,193/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN -wd4996 -MT ./src/Xml.cpp -FoC:/Users/Bobby/Documents/SVGTest/bin/windows/cpp/obj/obj/msvc16-debug-ncxp/2af284d7_Xml.obj
cl.exe -Iinclude -nologo -Od -DHX_WINDOWS -GR -Zi -Fdobj/msvc16-debug-ncxp/vc.pdb -Oy- -c -EHs -GS- -arch:SSE -IC:/HaxeToolkit/haxe/cpp/hxcpp/3,2,193/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN -wd4996 -MT ./src/XmlType.cpp -FoC:/Users/Bobby/Documents/SVGTest/bin/windows/cpp/obj/obj/msvc16-debug-ncxp/2af284d7_XmlType.obj
cl.exe -Iinclude -nologo -Od -DHX_WINDOWS -GR -Zi -Fdobj/msvc16-debug-ncxp/vc.pdb -Oy- -c -EHs -GS- -arch:SSE -IC:/HaxeToolkit/haxe/cpp/hxcpp/3,2,193/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN -wd4996 -MT ./src/format/gfx/GfxBytes.cpp -FoC:/Users/Bobby/Documents/SVGTest/bin/windows/cpp/obj/obj/msvc16-debug-ncxp/c534bae7_GfxBytes.obj
GfxBytes.cpp
./src/format/gfx/GfxBytes.cpp(233) : error C2679: binary ‘=’ : no operator found which takes a right-hand operand of type ‘int’ (or there is no acceptable conversion)
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(276): could be 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(const null &)'
with
[
OBJ_=openfl::display::GradientType_obj
]
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(277): or 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(openfl::display::GradientType_obj *)'
with
[
OBJ_=openfl::display::GradientType_obj
]
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(278): or 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(const hx::ObjectPtr<OBJ_> &)'
with
[
OBJ_=openfl::display::GradientType_obj
]
while trying to match the argument list ‘(openfl::display::GradientType, int)’
./src/format/gfx/GfxBytes.cpp(400) : error C2679: binary ‘=’ : no operator found which takes a right-hand operand of type ‘int’ (or there is no acceptable conversion)
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(276): could be 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(const null &)'
with
[
OBJ_=openfl::display::SpreadMethod_obj
]
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(277): or 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(openfl::display::SpreadMethod_obj *)'
with
[
OBJ_=openfl::display::SpreadMethod_obj
]
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(278): or 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(const hx::ObjectPtr<OBJ_> &)'
with
[
OBJ_=openfl::display::SpreadMethod_obj
]
while trying to match the argument list ‘(openfl::display::SpreadMethod, int)’
./src/format/gfx/GfxBytes.cpp(431) : error C2679: binary ‘=’ : no operator found which takes a right-hand operand of type ‘int’ (or there is no acceptable conversion)
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(276): could be 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(const null &)'
with
[
OBJ_=openfl::display::InterpolationMethod_obj
]
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(277): or 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(openfl::display::InterpolationMethod_obj *)'
with
[
OBJ_=openfl::display::InterpolationMethod_obj
]
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(278): or 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(const hx::ObjectPtr<OBJ_> &)'
with
[
OBJ_=openfl::display::InterpolationMethod_obj
]
while trying to match the argument list ‘(openfl::display::InterpolationMethod, int)’
./src/format/gfx/GfxBytes.cpp(523) : error C2679: binary ‘=’ : no operator found which takes a right-hand operand of type ‘int’ (or there is no acceptable conversion)
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(276): could be 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(const null &)'
with
[
OBJ_=openfl::display::LineScaleMode_obj
]
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(277): or 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(openfl::display::LineScaleMode_obj *)'
with
[
OBJ_=openfl::display::LineScaleMode_obj
]
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(278): or 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(const hx::ObjectPtr<OBJ_> &)'
with
[
OBJ_=openfl::display::LineScaleMode_obj
]
while trying to match the argument list ‘(openfl::display::LineScaleMode, int)’
./src/format/gfx/GfxBytes.cpp(554) : error C2679: binary ‘=’ : no operator found which takes a right-hand operand of type ‘int’ (or there is no acceptable conversion)
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(276): could be 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(const null &)'
with
[
OBJ_=openfl::display::CapsStyle_obj
]
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(277): or 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(openfl::display::CapsStyle_obj *)'
with
[
OBJ_=openfl::display::CapsStyle_obj
]
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(278): or 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(const hx::ObjectPtr<OBJ_> &)'
with
[
OBJ_=openfl::display::CapsStyle_obj
]
while trying to match the argument list ‘(openfl::display::CapsStyle, int)’
./src/format/gfx/GfxBytes.cpp(585) : error C2679: binary ‘=’ : no operator found which takes a right-hand operand of type ‘int’ (or there is no acceptable conversion)
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(276): could be 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(const null &)'
with
[
OBJ_=openfl::display::JointStyle_obj
]
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(277): or 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(openfl::display::JointStyle_obj *)'
with
[
OBJ_=openfl::display::JointStyle_obj
]
C:\HaxeToolkit\haxe\cpp\hxcpp\3,2,193\include\hx/Object.h(278): or 'hx::ObjectPtr<OBJ_> &hx::ObjectPtr<OBJ_>::operator =(const hx::ObjectPtr<OBJ_> &)'
with
[
OBJ_=openfl::display::JointStyle_obj
]
while trying to match the argument list ‘(openfl::display::JointStyle, int)’
./src/format/gfx/GfxBytes.cpp(817) : error C2664: ‘lime::utils::ByteArray_obj::writeByte’ : cannot convert parameter 1 from ‘openfl::display::GradientType’ to 'int’
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
./src/format/gfx/GfxBytes.cpp(916) : error C2664: ‘lime::utils::ByteArray_obj::writeByte’ : cannot convert parameter 1 from ‘openfl::display::SpreadMethod’ to 'int’
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
./src/format/gfx/GfxBytes.cpp(918) : error C2664: ‘lime::utils::ByteArray_obj::writeByte’ : cannot convert parameter 1 from ‘openfl::display::InterpolationMethod’ to 'int’
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
./src/format/gfx/GfxBytes.cpp(970) : error C2664: ‘lime::utils::ByteArray_obj::writeByte’ : cannot convert parameter 1 from ‘openfl::display::LineScaleMode’ to 'int’
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
./src/format/gfx/GfxBytes.cpp(972) : error C2664: ‘lime::utils::ByteArray_obj::writeByte’ : cannot convert parameter 1 from ‘openfl::display::CapsStyle’ to 'int’
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
./src/format/gfx/GfxBytes.cpp(974) : error C2664: ‘lime::utils::ByteArray_obj::writeByte’ : cannot convert parameter 1 from ‘openfl::display::JointStyle’ to 'int’
No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
XmlType.cpp
Xml.cpp
Build halted with errors.
Done(1)