Ver código fonte

【阅读页】选中图片,右键菜单,导出,点击三种格式,没有弹出导出图片弹窗 -- 修复

lizhe 6 meses atrás
pai
commit
dba69a21b5

+ 7 - 2
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m

@@ -4909,10 +4909,10 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
     }];
 }
 
-- (void)menuItemClick_StampExport: (NSMenuItem *)sender{
+- (void)menuItemClick_StampExport: (NSMenuItem *)sender {
+    NSImage *image = nil;
     if ([self.activeAnnotation isKindOfClass:[CPDFStampAnnotation class]]) {
         CPDFStampAnnotation *annotation = (CPDFStampAnnotation *)self.activeAnnotation;
-        NSImage *image = nil;
         if ([self.activeAnnotation isKindOfClass:[KMAnnotationStamp class]]) {
             image = annotation.stampImage;
         }
@@ -4928,6 +4928,11 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
             [[NSGraphicsContext currentContext] setImageInterpolation:NSImageInterpolationDefault];
             [image unlockFocus];
         }
+    } else if (self.currentSelection.selectionType == CPDFSelectionTypeImage) {
+        image = [self.document extractImageFromPage:self.currentSelection.page imageSelection:self.currentSelection];
+    }
+    
+    if (image) {
         NSData *data = [image TIFFRepresentation];
         NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:data];
         [imageRep setSize:[image size]];