Questions tagged [mask]

An image mask is a bitmap that specifies an area to paint, but not the color. In effect, an image mask acts as a stencil to specify where to place color on the page. Quartz uses the current fill color to paint an image mask.

A mask is a format expression mainly used in formatting user input in forms.

Common examples of this are date input fields that accepts only numbers and format the typed input with the needed characters:

User enters      Field contents
1                1
12               12
123              12/3
1231             12/31
...              ...
12312012         12/31/2012
2841 questions
11
votes
2 answers

Is 000,000,000.00 greater than zero?

I have an input mask on my text box like 000,000,000.00 I have the following jQuery code to check the value of text box before submitting data. var txt_box = $('#txt_box').attr('value'); if(txt_box <= 0 ) But now even if I didn't…
air
  • 6,136
  • 26
  • 93
  • 125
10
votes
4 answers

Best way to mask an image in HTML5

I was wondering what is the best way to mask images in HTML 5 ? In fact I would like to display circle thumbnails in a gallery without bothering my client with the preparation of the circular pictures... So I have, in my opinion, two options :…
Nypam
  • 1,458
  • 3
  • 11
  • 25
10
votes
2 answers

How to create reverse masks on CALayers

I'll make this as simple as possible. How do I create reverse masks on CALayers in iOS? I have a red view and an image that is used to mask the red view. I use the view's CALayer's mask property to apply the mask, the result is the…
Louis Boux
  • 1,228
  • 1
  • 12
  • 26
10
votes
2 answers

Shapely polygon to binary mask

I have seen this question asked but have not really been able to find a full response. I have a simple shapely polygon, called polygon. I would like to extract this polygon as a binary mask (ideally a numpy array). How would I go about doing this? I…
hex93
  • 319
  • 3
  • 15
10
votes
6 answers

Search with a mask

There is big array of entries having the following type: typedef struct { int value; int mask; int otherData; } Entry; I'd like to find an entry in this array according to provided int key; as fast as posible. The entry is required to…
Serge C
  • 2,205
  • 16
  • 23
10
votes
3 answers

"Clipping" Background to See Below Itself in Stacking Context

[ Note: Looking for a cross-browser solution that does not flash the body's background momentarily between each wave of goo as seen in ccprog's answer; Ideally, the solution should not involve waiting until the end of the first wave to begin…
oldboy
  • 5,729
  • 6
  • 38
  • 86
10
votes
3 answers

Android bitmap mask color, remove color

I am creating bitmap, next i am drawing second solid color bitmap on top of it. And now i want to change first bitmap, so solid color that i drawed on it will be transparent. Or simply, i want to remove all pixels of one color from bitmap. I havie…
ZZZ
  • 678
  • 2
  • 10
  • 26
10
votes
5 answers

Mask a portion of a String using RegExp

I'm trying to mask a portion of a string using JavaScript. e.g. Mask second and third segment of credit-card number like this using regex: 4567 6365 7987 3783 → 4567 **** **** 3783 3457 732837 82372 → 3457 ****** 82372 I just want to keep the…
Josue Soriano
  • 103
  • 1
  • 1
  • 6
10
votes
1 answer

How can UIVisualEffectView be used inside of a circle?

I'm making a custom control circle. Part of the circle may be transparent. It would make more visual sense and look better if it was translucent instead of transparent. Because views are rectangular, and I only want the circle to be translucent, not…
Eliza Wilson
  • 1,031
  • 1
  • 13
  • 38
10
votes
1 answer

Masking a CALayer - iPhone

I'm creating a custom on / off toggle switch for the iPhone (similar to the standard switch) and i'm at the point where I'm setting the mask of the slider, but calling [[myView layer] setMask:maskLayer] sets the position of the mask layer relative…
jtrim
  • 3,465
  • 4
  • 31
  • 44
10
votes
1 answer

How to pre-populate 9 with jQuery Masked Input Plugin?

I am using Masked Input Plugin from digitalBush for jQuery, which is very simple to use. For some cases, I want to pre-populate data for the client, so for something like this : .mask("123999") client will see: 123___ And will need to insert last…
Ivan Sokalskiy
  • 812
  • 7
  • 14
9
votes
2 answers

How to get a CGImageRef from Context-Drawn Images?

Ok using coregraphics, I'm building up an image which will later be used in a CGContextClipToMask operation. It looks something like the following: UIImage *eyes = [UIImage imageNamed:@"eyes"]; UIImage *mouth = [UIImage…
NonatomicRetain
  • 301
  • 4
  • 14
9
votes
2 answers

Is there a correct way to mask a 15 digit credit card number?

15 digit bank card numbers are formatted 0000-000000-00000[1]. If I show the last 4 digits, it becomes xxxx-xxxxxx-x0000 which looks slightly goofy. Is there a correct way to format a masked 15 digit number? (I expect we will not show more than the…
700 Software
  • 85,281
  • 83
  • 234
  • 341
9
votes
1 answer

Pandas Mask on multiple Conditions

In my dataframe I want to substitute every value below 1 and higher than 5 with nan. This code works persDf = persDf.mask(persDf < 1000) and I get every value as an nan but this one does not: persDf = persDf.mask((persDf < 1) and (persDf >…
ruedi
  • 5,365
  • 15
  • 52
  • 88
9
votes
4 answers

Should a cast be used to truncate a long variable?

I have a 16 bits unsigned variable. I need to split it in 8 bits chunks. Is doing the following enough: chunk_lsb = (uint8)variable; chunk_msb = (uint8)(variable >> 8); Or should I use a mask: chunk_lsb = (uint8)(variable & 0xFFu); chunk_msb =…
Soyding Mete
  • 137
  • 8