|
@@ -25,6 +25,7 @@ using System.Text;
|
|
using ComPDFKitViewer.Helper;
|
|
using ComPDFKitViewer.Helper;
|
|
using ComPDFKit.Viewer.Helper;
|
|
using ComPDFKit.Viewer.Helper;
|
|
using System.Drawing.Imaging;
|
|
using System.Drawing.Imaging;
|
|
|
|
+using System.Reflection;
|
|
|
|
|
|
namespace Compdfkit_Tools.PDFControl
|
|
namespace Compdfkit_Tools.PDFControl
|
|
{
|
|
{
|
|
@@ -636,7 +637,7 @@ namespace Compdfkit_Tools.PDFControl
|
|
DrawingVisual copyVisual = new DrawingVisual();
|
|
DrawingVisual copyVisual = new DrawingVisual();
|
|
DrawingContext copyContext = copyVisual.RenderOpen();
|
|
DrawingContext copyContext = copyVisual.RenderOpen();
|
|
|
|
|
|
- Color color= ParamConverter.ConverterByteForColor(inkParam.InkColor);
|
|
|
|
|
|
+ Color color = ParamConverter.ConverterByteForColor(inkParam.InkColor);
|
|
color.A = inkParam.Transparency;
|
|
color.A = inkParam.Transparency;
|
|
Pen drawPen = new Pen(new SolidColorBrush(color), inkParam.Thickness);
|
|
Pen drawPen = new Pen(new SolidColorBrush(color), inkParam.Thickness);
|
|
copyContext?.DrawGeometry(null, drawPen, PaintGeomtry);
|
|
copyContext?.DrawGeometry(null, drawPen, PaintGeomtry);
|
|
@@ -908,20 +909,29 @@ namespace Compdfkit_Tools.PDFControl
|
|
annotationPanel = pdfLinkUI;
|
|
annotationPanel = pdfLinkUI;
|
|
break;
|
|
break;
|
|
case CPDFAnnotationType.Audio:
|
|
case CPDFAnnotationType.Audio:
|
|
- //SoundAnnotArgs soundArgs = new SoundAnnotArgs();
|
|
|
|
- //OpenFileDialog openAudioDialog = new OpenFileDialog();
|
|
|
|
- //openAudioDialog.Filter = "Wave Files(*.wav)|*.wav|All Files(*.*;)|*.*;";
|
|
|
|
- //if (openAudioDialog.ShowDialog() == true)
|
|
|
|
- //{
|
|
|
|
- // soundArgs.SoundFilePath = openAudioDialog.FileName;
|
|
|
|
- // this.pdfViewerControl.SetMouseMode(MouseModes.AnnotCreate);
|
|
|
|
- // pdfViewerControl.SetToolParam(soundArgs);
|
|
|
|
- //}
|
|
|
|
- //else
|
|
|
|
- //{
|
|
|
|
- // this.pdfViewerControl.SetMouseMode(MouseModes.PanTool);
|
|
|
|
- // ClearAnnotationBar?.Invoke(this, EventArgs.Empty);
|
|
|
|
- //}
|
|
|
|
|
|
+ SoundParam soundParam = new SoundParam();
|
|
|
|
+ soundParam.CurrentType = C_ANNOTATION_TYPE.C_ANNOTATION_SOUND;
|
|
|
|
+ OpenFileDialog openAudioDialog = new OpenFileDialog();
|
|
|
|
+ openAudioDialog.Filter = "Wave Files(*.wav)|*.wav|All Files(*.*;)|*.*;";
|
|
|
|
+ if (openAudioDialog.ShowDialog() == true)
|
|
|
|
+ {
|
|
|
|
+ BitmapImage img = new BitmapImage(new Uri("pack://application:,,,/Compdfkit_Tools;component/Asset/Resource/SoundAnnot.png"));
|
|
|
|
+ PngBitmapEncoder encoder = new PngBitmapEncoder();
|
|
|
|
+ encoder.Frames.Add(BitmapFrame.Create(img));
|
|
|
|
+ MemoryStream memoryStream = new MemoryStream();
|
|
|
|
+ encoder.Save(memoryStream);
|
|
|
|
+
|
|
|
|
+ soundParam.ImageStream = memoryStream;
|
|
|
|
+ soundParam.SoundFilePath = openAudioDialog.FileName;
|
|
|
|
+ pdfViewerControl.SetToolType(ToolType.CreateAnnot);
|
|
|
|
+ pdfViewerControl.SetCreateAnnotType(C_ANNOTATION_TYPE.C_ANNOTATION_SOUND);
|
|
|
|
+ pdfViewerControl.SetAnnotParam(soundParam);
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ pdfViewerControl.SetToolType(ToolType.Pan);
|
|
|
|
+ ClearAnnotationBar?.Invoke(this, EventArgs.Empty);
|
|
|
|
+ }
|
|
ClearPanel();
|
|
ClearPanel();
|
|
break;
|
|
break;
|
|
case CPDFAnnotationType.Image:
|
|
case CPDFAnnotationType.Image:
|