Hi
I've seen examples to load vector images using the 32bit version. We currently have an issue loading them using the 64 bit version.
I have a .dwg file and the code we have looks like this:
------------------------------------------------------------------------------------
LeadToolsApi.LOADFILEOPTION oLoadOption = new LeadToolsApi.LOADFILEOPTION();
LeadToolsApi.BITMAPHANDLE pBitMap = new LeadToolsApi.BITMAPHANDLE();
RasterImage oTempRaster = null;
LeadToolsApi.FILEINFO oFileInfo = new LeadToolsApi.FILEINFO();
...
int iReturn = LeadToolsApi.L_LoadBitmap(sOriginalFilePath, ref pBitMap, LeadToolsApi.BITMAPHANDLE.SizeOf, 0, LeadToolsApi.ORDER.ORDER_BGRORGRAY, ref oLoadOption, ref oFileInfo);
if (pBitMap.Flags == (LeadToolsApi.BITMAPHANDLE.BITMAPHANDLEFLAGS.Allocated | LeadToolsApi.BITMAPHANDLE.BITMAPHANDLEFLAGS.ConventionalMemory))
{
IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(pBitMap));
Marshal.StructureToPtr(pBitMap, ptr, false);
oTempRaster = RasterImageConverter.FromLeadBitmap(ptr);
Marshal.FreeHGlobal(ptr);
LeadToolsApi.L_FreeBitmap(ref pBitMap);
}
return oTempRaster;
------------------------------------------------------------------------------------
We get the following exception:
2/7/2011 12:27:28 PM System.BadImageFormatException: Could not load file or assembly 'Leadtools.Codecs.Djv, Version=16.5.0.0, Culture=neutral, PublicKeyToken=xxxx' or one of its dependencies. An attempt was made to load a program with an incorrect format.
File name: 'Leadtools.Codecs.Djv, Version=16.5.0.0, Culture=neutral, PublicKeyToken=xxxxx'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.Load(String assemblyString)
at Leadtools.Internal.L_DllLoader`1.Load(Char* , Char* , Char* )
at Leadtools.Internal.L_DllLoader`1.LoadWithPath(Char* , Char* , Char* )
at ?A0x26aadf20.LoadFileFilter(_FILEFILTER* pFilter)
at ?A0x26aadf20.ManagedUseFilter(_FILEFILTER* pFilter)
at UseFilter(_FILEFILTER* )
at ManagedFLTINFO(Int32 fmt, _INFODISPATCH* dis)
at L_FileInfo(Char* , _FILEINFO* , UInt32 , UInt32 , _LOADFILEOPTION* )
at Leadtools.Codecs.RasterCodecs.DoGetInformation(String fileName, Stream stream, Boolean totalPages, Int32 pageNumber)
at Leadtools.Codecs.RasterCodecs.GetInformation(String fileName, Boolean totalPages)
at JIC.Business.ImageProcessing.GetSourceFilePages(JIC_Control oJICControl, Boolean& bUsePixels, Int32 pageIndex)
at JIC.Business.ImageProcessing.ProcessControl(JIC_Control oJICControl, Int32 pageIndex)
at JIC.Business.ImageProcessing.ProcessControl(JIC_Control oJICControl)
What are we doing wrong? And is there an example for 64 bit that someone can send us.