fix: loading state from open url

fix: some animation export error
This commit is contained in:
Tsanie Lily 2020-05-17 02:33:28 +08:00
parent 8f11b3d722
commit 2469a5ba88
2 changed files with 11 additions and 5 deletions

View File

@ -317,7 +317,8 @@ namespace Pixiview.Illust
{ {
tmp[i] = new IllustDetailItem tmp[i] = new IllustDetailItem
{ {
Id = illustItem.Id Id = illustItem.Id,
Loading = true
}; };
} }
Illusts = items = tmp; Illusts = items = tmp;

View File

@ -455,12 +455,17 @@ namespace Pixiview.Utils
{ {
var cgImage = images[i].CGImage; var cgImage = images[i].CGImage;
var width = cgImage.Width; var width = cgImage.Width;
using (CGBitmapContext bitmapContext = new CGBitmapContext(pxdata, width, cgImage.Height, var height = cgImage.Height;
8, 4 * (width + width % 8), rgbColorSpace, CGImageAlphaInfo.NoneSkipFirst)) using (CGBitmapContext bitmapContext = new CGBitmapContext(
pxdata, width, height,
cgImage.BitsPerComponent,
4 * (width + width % 4),
rgbColorSpace,
CGImageAlphaInfo.NoneSkipFirst))
{ {
if (bitmapContext != null) if (bitmapContext != null)
{ {
bitmapContext.DrawImage(new CGRect(0, 0, cgImage.Width, cgImage.Height), cgImage); bitmapContext.DrawImage(new CGRect(0, 0, width, height), cgImage);
} }
} }
} }
@ -482,7 +487,7 @@ namespace Pixiview.Utils
lastTime = CMTime.Add(lastTime, frameTime); lastTime = CMTime.Add(lastTime, frameTime);
break; break;
} }
Thread.Sleep(100); Thread.Sleep(16);
} }
} }
writerInput.MarkAsFinished(); writerInput.MarkAsFinished();