admin管理员组

文章数量:1400771

why this dot net maui code is giving null in _cadImage when running in android ? NOTE: it is working in windows.

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

本文标签: netAspose CAD file not loading in androidStack Overflow