private void LoadImage(SKPaintSurfaceEventArgs e, SKCanvas canvas)
{
try
{
string fileName = "CADproject.Doc.sample.dwg";
string appDataPath = FileSystem.AppDataDirectory;
string localFilePath = Path.Combine(appDataPath, fileName);
if (!File.Exists(localFilePath))
{
using (Stream resourceStream = GetType().Assembly.GetManifestResourceStream(fileName))
{
if (resourceStream == null)
{
throw new FileNotFoundException("Embedded resource not found.", fileName);
}
using (FileStream fileStream = new FileStream(localFilePath, FileMode.Create, FileAccess.Write))
{
resourceStream.CopyTo(fileStream);
}
}
}
cadFilePath = localFilePath;
_cadImage = (CadImage)Aspose.CAD.Image.Load(cadFilePath);
}
this is working for windows, but when running for android, the _cadImage
is showing null, while in windows it is perfectly loading _cadImage
the exception we are getting is :- Aspose.CAD.CadExceptions.ImageLoadException: 'Drawing loading failed: ’
we are getting the same issue in ios as well.