|
@@ -117,7 +117,29 @@ namespace Compdfkit_Tools.PDFControl
|
|
|
tempSignatureConfig.IsDrawLogo = (bool)LogoChk.IsChecked;
|
|
|
if (tempSignatureConfig.IsDrawLogo)
|
|
|
{
|
|
|
- tempSignatureConfig.LogoData = CommonHelper.ConvertBitmapToByteArray(new Bitmap(logoPath));
|
|
|
+ using (FileStream fileData = File.OpenRead(logoPath))
|
|
|
+ {
|
|
|
+ BitmapFrame frame = null;
|
|
|
+ BitmapDecoder decoder = BitmapDecoder.Create(fileData, BitmapCreateOptions.None, BitmapCacheOption.Default);
|
|
|
+ if (decoder != null && decoder.Frames.Count > 0)
|
|
|
+ {
|
|
|
+ frame = decoder.Frames[0];
|
|
|
+ }
|
|
|
+ if (frame != null)
|
|
|
+ {
|
|
|
+ byte[] imageArray = new byte[frame.PixelWidth * frame.PixelHeight * 4];
|
|
|
+ //int ImageWidth = frame.PixelWidth;
|
|
|
+ //int ImageHeight = frame.PixelHeight;
|
|
|
+ frame.CopyPixels(imageArray, frame.PixelWidth * 4, 0);
|
|
|
+ if(signatureWidget.IsValid())
|
|
|
+ {
|
|
|
+ tempSignatureConfig.LogoData = imageArray;
|
|
|
+ //signatureWidget.UpdateApWithImage(ImageArray, ImageWidth, ImageHeight, C_Scale_Type.fitCenter, 0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //tempSignatureConfig.LogoData = CommonHelper.ConvertBitmapToByteArray(new Bitmap(logoPath));
|
|
|
}
|
|
|
tempSignatureConfig.Content = Text;
|
|
|
tempSignatureConfig.TextColor = textColor;
|