mask

UIView Layer Mask Animate

寵の児 提交于 2019-12-08 23:58:46
问题 I am trying to animate the mask layer on a UIView. Basically this code displays the image below: let bounds: CGRect = self.manualWBMaskView!.bounds let maskLayer: CAShapeLayer = CAShapeLayer() maskLayer.frame = bounds maskLayer.fillColor = UIColor.blackColor().CGColor let screenWith : CGFloat = UIScreen.mainScreen().bounds.width let roundedRectFrame : CGRect = CGRectMake(self.manualWBMaskView!.bounds.midX - (screenWith/4), self.manualWBMaskView!.bounds.midY - (screenWith/4), screenWith/2,

An SVG rectangle with multiple holes using Snap.svg

北战南征 提交于 2019-12-08 23:12:36
I'm trying to get a rectangle with many (transparent, not just of the same color as the background!) round holes, but my code does the opposite. I know why, but I don know how to generate a suitable mask shape in this case: var s = Snap(500, 500); var rectangle = s.rect(10, 10, 250, 250, 0, 0).attr({'fill':'white', 'stroke':'white'}); var group = s.group(); group.append(s.rect(10,10,250,250).attr({ fill: 'white'})) for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) { s.circle(25+i*25, 25+j*25, 10).attr({'fill':'black', 'stroke':'black'}).appendTo(group); } } rectangle.attr({'mask':group}); I'm

ios- zoom and rotate a masked UIImageView [closed]

你离开我真会死。 提交于 2019-12-08 09:07:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I'm new to iOS and need to have the needs below. Please give me some directions on how to do this. Thanks! Have an image(source) masked by another image (frame) User can drag,zoom, rotate the source image. The frame image keeps still. I know how to use CGImageCreateWithMask and how to put uiimageview inside a

CIFilter + UIImage + alpha mask

最后都变了- 提交于 2019-12-08 07:11:08
问题 I'm using such solution to mask my UIImage with some alpha drawing: masking an UIImage The problem is that later i want to apply some CIFilters . However when i change value of the filter, my alpha gets lost from UIImage . Do i have to re-apply the alpha channel to output image each time after modifying CIFilter? This will surely make the process much slower. Samples of code: (each new paragraph is in another method) // set the image _image = [incomeImage imageWithMask:_mask]; //

Circular hole in a <div> [duplicate]

拜拜、爱过 提交于 2019-12-08 06:35:52
问题 This question already has answers here : Transparent hollow or cut out circle (6 answers) Closed 4 years ago . I am looking for a way to create a square div of relative size, say, 70% x 70% with a background color and a circular hole in it (so that the background can be seen behind it) of the same size so that the sides of the div are tangent. 回答1: You could use radial-gradient to achieve this. html, body { height: 100%; margin: 0; background: url(http://www.lorempixel.com/600/400) 100% 100%;

How to make JTextField or JFormattedTextField accept input only if it matches a REGEX pattern?

让人想犯罪 __ 提交于 2019-12-08 05:43:31
问题 I want a few JTextField within my program to only accept new input if it matches an specific Pattern . I know about JFormattedTextField 's masks and that is not what I want here. For each new input, the text should only accept the changes if those comply with the flow of an specific regex pattern. This has to be done with regex because of "regex-demanding" situations, like if the input should receive parts of itself. This is better understood with an example: Suppose my regex is "(\\d{2})-bk\

An SVG rectangle with multiple holes using Snap.svg

六眼飞鱼酱① 提交于 2019-12-08 05:20:54
问题 I'm trying to get a rectangle with many (transparent, not just of the same color as the background!) round holes, but my code does the opposite. I know why, but I don know how to generate a suitable mask shape in this case: var s = Snap(500, 500); var rectangle = s.rect(10, 10, 250, 250, 0, 0).attr({'fill':'white', 'stroke':'white'}); var group = s.group(); group.append(s.rect(10,10,250,250).attr({ fill: 'white'})) for (i = 0; i < 5; i++) { for (j = 0; j < 5; j++) { s.circle(25+i*25, 25+j*25,

Mask and Clip GLSurfaceView

大憨熊 提交于 2019-12-08 03:09:56
问题 I work with an SDK that provides a rectangular glsurfaceview through a callback. I want to be able to render this view in a circular layout. (i.e.) I would like to display the view on a circular view I have tried using masking layout such as using a maskable layout https://github.com/christophesmet/android_maskable_layout (works great for images, not so much for videos) How do I go about clipping and rendering this as a circle? (The background is constantly changing, so i cant overlay a

Fill oceans in basemap [duplicate]

感情迁移 提交于 2019-12-07 17:52:04
问题 This question already has answers here : Plot only on continent in matplotlib (5 answers) Closed last year . I am trying to plot 1x1 degree data on a matplotlib.Basemap , and I want to fill the ocean with white. However, in order for the boundaries of the ocean to follow the coastlines drawn by matplotlib , the resolution of the white ocean mask should be much higher than the resolution of my data. After searching around for a long time I tried the two possible solutions: (1) maskoceans() and

PHP - Mask polygon over image

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 07:31:03
问题 Hi Everyone (this is my first post), I am trying to figure a way of cropping a polygon out of an image. I have been reading other similar code. It seems that most code is based around the following process: Resize the image to fit the width and height of the polygon shape, Create a blank image of an unusual colour the same size, Overlay transparent pixels in the shape of the polygon, Overlay that on to the resized image Set the unusual colour to be transparent... My problem is I do not want