因要做个小功能,将cdr文件转成图片格式,在c#调试成功,但因实施麻烦,想转成au3的
在使用过程式中发现au3不能调用CorelDRAW里定义里的namespace
请问有办法解决吗
谢谢Local $oShell = ObjCreate("CorelDRAW.Application")
If @error Then
MsgBox(0,0,@error)
EndIf
If IsObj($oShell) Then
$oShell.OpenDocument("c:\1.cdr",0)
$oShell.ActiveDocument.ExportBitmap("C:\1.png",CorelDRAW.cdrFilter.cdrPNG,CorelDRAW.cdrExportRange.cdrCurrentPage,CorelDRAW.cdrImageType.cdrRGBColorImage,0, 0, 72, 72,CorelDRAW.cdrAntiAliasingType.cdrNoAntiAliasing,false,true,true,false,CorelDRAW.cdrCompressionType.cdrCompressionNone)
$oShell.ActiveDocument.Close();
$oShell.Quit();
EndIf
如下为c#代码,可以正常运行; private static void ConvertCDR2JPG(string Sourcefile, string Targetfile)
{
CorelDRAW.Application cdr = new CorelDRAW.Application();
cdr.OpenDocument(Sourcefile, 1);
cdr.ActiveDocument.ExportBitmap(Targetfile,
CorelDRAW.cdrFilter.cdrJPEG,
CorelDRAW.cdrExportRange.cdrCurrentPage,
CorelDRAW.cdrImageType.cdrRGBColorImage,
0, 0, 100, 100,
CorelDRAW.cdrAntiAliasingType.cdrNoAntiAliasing,
false,
true,
true,
false,
CorelDRAW.cdrCompressionType.cdrCompressionJPEG,
null).Finish();
cdr.ActiveDocument.Close();
cdr.Quit();
}
|