mask

How can I use a PathGeometry as a mask for a BitmapSource (or any image data)?

Assuming I have a BitmapSource (actually I have access to the raw pixels as well if necessary), how can I use a PathGeometry as a mask to cut out certain parts of the image? 01234567890123456789 0 -------------------- 1 | + + | 2 | * | 3 | * ) | 4 | * | 5 | ( ...

Masking a Drawable/Bitmap on Android

I'm currently looking for a way to use a black and white bitmap to mask the alpha channel of another bitmap or Drawable on Android. I'm curious as to what the best way to do this is. I certainly have a couple of ideas for how to do this, but they are not optimal. I need to be able to apply a new mask to the image every so often (the b...

Help with regular expression mask for Time Span in the format hh:mm

I need to set a mask on a text box control for a time duration field in the format hh:mm. hh runs be from 00 - 12 and mm can be from 00 to 59. The user can enter negative number to denote negative duration. some examples of valid values are -12:23 12.23 01:00 12:00 I have the following regular expression, which partially works: ...

How do I shrink a matrix using an array mask in MATLAB?

This seems to be a very common problem of mine: data = [1 2 3; 4 5 6]; mask = [true false true]; mask = repmat(mask, 2, 1); data(mask) ==> [1; 4; 3; 6] What I wanted was [1 3; 4 6]. Yes I can just reshape it to the right size, but that seems the wrong way to do it. Is there a better way? Why doesn't data(mask) return a matrix whe...

AS3 Flex masks with black background from png bitmap

Hi all What I am trying to achieve might be trivial, however I am loading a PNG mask which does not have a transparent background, but rather a black background, with the shape defined on top in white (the actual mask which needs to be applied). Apparently Flex expects me to provide a mask with a transparent background for it to work, o...

Flash CS3/AS3 - How to Mask Nested MovieClips in External Classes

I have a number of external class files that make up (or are trying to build) a portfolio. One of the class files for this project is a Menu.as class I tried extends, but I'm yet to use extends to where it doesn't become a ball of tangled holiday cheer. So my main portfolio class (the one where I'm assembling everything) calls an instan...

FLASH actionscript round corners mask?

How can I mask my flash movie dynamically using actionscript to create a 5 pixels rounded mask in the 4 corners? (the corners should be transparent, the rest should be visible) Thanks! ...

masking a UIImage

I'm working on an app that can change the borders or a rectangular UIImage. The borders will vary, but will look like the UIImage was cut out with scissors, or something to that affect. What is the best way to do this? My first thought is to prep a bunch of transparent PNGs with the correct border effect I'm looking for, and then someh...

How to calculate a subnet mask from IP address?

I just want to understand how this software works: http://www.subnet-calculator.com/ ...

Format an input with Jquery?

I'm building a calculator that has a slider. Everytime I slide the bar an input box is updated with the number, the calculator passes the value and updates the calculation. So my input boxes have dollar values that can range anywhere from $0 to $10,000. Right now my boxes display 0 to 10000 and I want them to be displayed as $0 to $10...

Replace all white/nearly white pixels in a UIImage with alpha using CGImage?

Hi there, I have a UIImage with white background. I would like replace the white background/pixels with alpha-transparent pixels. I've looked at other questions on StackOverflow, along with Quartz documentation, but have yet to find a coherent "start-to-end" for this problem. How is this done? ...

How to mask part of an image in matlab ?

Hey guys, I would like to know how to mask part of an image that is in BLACK & WHITE ? I got an object that needs to be edge detected, but I have other white interfering objects in the background that are below the target objet ... I would like to mask the entire lower part of an image to black, how can I do that ? Thanks !! EDIT I ...

Animating a CALayer's mask size change

I have a UIView subclass which uses a CAShapeLayer mask on its CALayer. The mask uses a distinct shape, with three rounded corners and a cut out rectangle in the remaining corner. When I resize my UIView using a standard animation block, the UIView itself and its CALayer resize just fine. The mask, however, is applied instantly, which l...

Masked Input Using EditText Widget in Android

Is there a way I can specify an input mask to the EditText control in Android? I want be able to specify something like ### - ## - #### for a Social Security Number. This will cause any invalid input to be rejected automatically (example, I type alphabetical characters instead of numeric digits). I realize that I can add an OnKeyListen...

Converting CIDR address to subnet mask and network address

Given a CIDR address, e.g. 192.168.10.0/24 How to determine mask length? (24) How to determine mask address? (255.255.255.0) How to determine network address? (192.168.10.0) ...

How to mask image with another image in ActionScript 3.0

Hi Gurus, my issue is this, my users import an image with FileReference and I need to mask it and then send it to server. My problem is this: I'm be able do keep the filereference event and transfer the image data into my canvas. I'm be able to send to server the result of masking. But I'm NOT be able to mask the image that my users...

Multi layer alpha image slideshow. AS3 right tool for the job?

Hi All, I need to build a portfolio for a photographer and am trying to figure out the best approach. I could use some suggestions here! REQS: 3 layers of images (groups) with a parallaxe like effect, meaning: trough gaps in top layer you see the second and through that the third layer. subsequent layers appear incrementally small...

Using a mask over a transparant background (Flash)

Hi, I'm having a hard time with this and I'm hoping someone can point me in the right direction. First some details about what I am trying to achieve: I'm making a Flash file with Actionscript 3. The SWF I'm creating is supposed to be a scratchcard with a dynamic background (i.e. the covered picture and the location of the SWF can ch...

Wpf Volumetric effect ?

I would like to know if WPF support 3D Volumetric Effects like "spotlight (sort of smoke effect like in nightclub)" Typically, I would like to set a brush (sort of mask or filter : color + shape ) and see "light ray" from light source to any obstacle.. i'm not sure wpf can handle that, if it doesn't what's the best software to do that...

How can I create masking like this in AS3?

I've worked a little bit with masks in AS3 but I'm not sure how I can do this with masks. I have two swf files that I have imported onto the Library as MC's with class names. One of the files is the start image and the other is the end image. The transition is a slide transition from the start image to the end image. You can think of t...