|
@@ -13,6 +13,8 @@ namespace ComPDFKit.Tool
|
|
public partial class CPDFViewerTool
|
|
public partial class CPDFViewerTool
|
|
{
|
|
{
|
|
int selectImageTag = -1;
|
|
int selectImageTag = -1;
|
|
|
|
+ private bool enableImageSelect = true;
|
|
|
|
+
|
|
private void InsertSelectImageView()
|
|
private void InsertSelectImageView()
|
|
{
|
|
{
|
|
SelectImage createAnnotTool = new SelectImage();
|
|
SelectImage createAnnotTool = new SelectImage();
|
|
@@ -20,10 +22,24 @@ namespace ComPDFKit.Tool
|
|
PDFViewer.InsertView(SelectTextindex, createAnnotTool);
|
|
PDFViewer.InsertView(SelectTextindex, createAnnotTool);
|
|
selectImageTag = createAnnotTool.GetResTag();
|
|
selectImageTag = createAnnotTool.GetResTag();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public void SetImageSelectEnable(bool enable)
|
|
|
|
+ {
|
|
|
|
+ enableImageSelect=enable;
|
|
|
|
+ if (enableImageSelect==false && PDFViewer!=null)
|
|
|
|
+ {
|
|
|
|
+ SelectImage imageLayer = PDFViewer.GetViewForTag(selectImageTag) as SelectImage;
|
|
|
|
+ if (imageLayer != null)
|
|
|
|
+ {
|
|
|
|
+ imageLayer.CleanDraw(PDFViewer);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
public bool DrawMoveSelectImage()
|
|
public bool DrawMoveSelectImage()
|
|
{
|
|
{
|
|
bool isSelect = false;
|
|
bool isSelect = false;
|
|
- if (PDFViewer.CurrentRenderFrame == null)
|
|
|
|
|
|
+ if (PDFViewer.CurrentRenderFrame == null || enableImageSelect == false)
|
|
{
|
|
{
|
|
return isSelect;
|
|
return isSelect;
|
|
}
|
|
}
|
|
@@ -40,7 +56,7 @@ namespace ComPDFKit.Tool
|
|
public bool DrawDownSelectImage(bool isNeedClear)
|
|
public bool DrawDownSelectImage(bool isNeedClear)
|
|
{
|
|
{
|
|
bool isSelect = false;
|
|
bool isSelect = false;
|
|
- if (PDFViewer.CurrentRenderFrame == null)
|
|
|
|
|
|
+ if (PDFViewer.CurrentRenderFrame == null || enableImageSelect == false)
|
|
{
|
|
{
|
|
return isSelect;
|
|
return isSelect;
|
|
}
|
|
}
|
|
@@ -57,12 +73,20 @@ namespace ComPDFKit.Tool
|
|
|
|
|
|
public void ReDrawSelectImage()
|
|
public void ReDrawSelectImage()
|
|
{
|
|
{
|
|
|
|
+ if(enableImageSelect == false)
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
BaseLayer baseLayer = PDFViewer.GetViewForTag(selectImageTag);
|
|
BaseLayer baseLayer = PDFViewer.GetViewForTag(selectImageTag);
|
|
(baseLayer as SelectImage).Draw(PDFViewer);
|
|
(baseLayer as SelectImage).Draw(PDFViewer);
|
|
}
|
|
}
|
|
|
|
|
|
public void CleanDrawSelectImage()
|
|
public void CleanDrawSelectImage()
|
|
{
|
|
{
|
|
|
|
+ if (enableImageSelect == false)
|
|
|
|
+ {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
BaseLayer baseLayer = PDFViewer.GetViewForTag(selectImageTag);
|
|
BaseLayer baseLayer = PDFViewer.GetViewForTag(selectImageTag);
|
|
(baseLayer as SelectImage).CleanDraw(PDFViewer);
|
|
(baseLayer as SelectImage).CleanDraw(PDFViewer);
|
|
}
|
|
}
|
|
@@ -75,6 +99,10 @@ namespace ComPDFKit.Tool
|
|
|
|
|
|
public Dictionary<int, List<PageImageItem>> GetSelectImageItems()
|
|
public Dictionary<int, List<PageImageItem>> GetSelectImageItems()
|
|
{
|
|
{
|
|
|
|
+ if (enableImageSelect == false)
|
|
|
|
+ {
|
|
|
|
+ return new Dictionary<int, List<PageImageItem>>();
|
|
|
|
+ }
|
|
BaseLayer baseLayer = PDFViewer.GetViewForTag(selectImageTag);
|
|
BaseLayer baseLayer = PDFViewer.GetViewForTag(selectImageTag);
|
|
return (baseLayer as SelectImage).GetSelectImageItems();
|
|
return (baseLayer as SelectImage).GetSelectImageItems();
|
|
}
|
|
}
|