|
@@ -173,7 +173,26 @@ namespace ComPDFKit.Tool.Help
|
|
|
frame.CopyPixels(imageData, frame.PixelWidth * 4, 0);
|
|
|
}
|
|
|
|
|
|
- imageWidth = frame.PixelWidth;
|
|
|
+ int stride = ((int)frame.PixelWidth) * 4;
|
|
|
+ for (int i = 0; i < (int)(frame.PixelHeight); i++)
|
|
|
+ {
|
|
|
+ for (int j = 0; j < (int)(frame.PixelWidth); j++)
|
|
|
+ {
|
|
|
+ byte b = imageData[i * stride + j * 4];
|
|
|
+ byte g = imageData[i * stride + j * 4 + 1];
|
|
|
+ byte r = imageData[i * stride + j * 4 + 2];
|
|
|
+ byte a = imageData[i * stride + j * 4 + 3];
|
|
|
+
|
|
|
+ if (a == 0 && b == 0 && g == 0 && r == 0)
|
|
|
+ {
|
|
|
+ imageData[i * stride + j * 4] = 255;
|
|
|
+ imageData[i * stride + j * 4 + 1] = 255;
|
|
|
+ imageData[i * stride + j * 4 + 2] = 255;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ imageWidth = frame.PixelWidth;
|
|
|
imageHeight = frame.PixelHeight;
|
|
|
}
|
|
|
}
|