PDFWatermarkClipView.m 649 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // CPDFClipView.m
  3. // PDFViewer
  4. //
  5. // Created by kdanmobile_2 on 2022/12/23.
  6. //
  7. #import "PDFWatermarkClipView.h"
  8. @implementation PDFWatermarkClipView
  9. - (instancetype)initWithFrame:(CGRect)frame {
  10. self = [super initWithFrame:frame];
  11. if (self) {
  12. self.backgroundColor = [UIColor clearColor];
  13. }
  14. return self;
  15. }
  16. - (void)drawRect:(CGRect)rect {
  17. [super drawRect:rect];
  18. CGContextRef context = UIGraphicsGetCurrentContext();
  19. CGContextSetFillColorWithColor(context, [UIColor grayColor].CGColor);
  20. CGContextFillRect(context, self.frame);
  21. CGContextClearRect(context,_documentRect);
  22. }
  23. @end