Menu
  • HOME
  • TAGS

An SVG rectangle with multiple holes using Snap.svg

javascript,svg,mask,snap.svg

For masks, white means solid and black means transparent. So to make a mask that gives the effect of holes, it needs to be filled with white (you can use a rect for that) and make the holes black.

Loading delay extjs

javascript,extjs,panel,loading,mask

I would suggest you to first show your masking like the way you are doing: var myMask = new Ext.LoadMask(Ext.getCmp('eventsPanel'), { msg:"Please wait..." }); myMask.show(); Then make a delayed task var task = new Ext.util.DelayedTask(function(){ //your loading panel2 with heavy data goes here myMask.hide(); }); //start the task after 500...

Multi region mask OpenCV

c++,opencv,mask,mat

Use cv::rectangle(): //bounds are inclusive in this code! cv::Rect region(x_lowbound1, y_lowbound1, x_highbound1 - x_lowbound1 + 1, y_highbound1 - y_lowbound1 + 1) cv::rectangle(mymask, region, cv::Scalar(255), CV_FILLED); ...

GLSL dark seams between masks

glsl,mask,multitexturing

This is because of linear interpolation of texels. You get "in beetween values" which are half blue and half red. Thus resulting in grey. you may switch off texture interpolation. Or try: vec4 m0=texture2D(mask[0], vUv); gl_FragColor= gl_FragColor*(1.0-m0.r-m0.b)+texture2D(texture[1], 32.0*vUv)*m0.r+texture2D(texture[3], 32.0*vUv)*m0.b; ...

How to enable to insert spaces in masked input plugin (JQuery Plugin)?

javascript,jquery,mask

In case if you use http://github.com/RobinHerbots/jquery.inputmask , you can create your own mask: $.extend($.inputmask.defaults.definitions, { 'A': { validator: "[A-Za-z0-9 ]", cardinality: 1 } }); $("#field").inputmask("AAA"); If you use http://plugins.jquery.com/maskedinput/ , you create you mask like this: $.mask.definitions['A'] = "[A-Za-z0-9 ]"; $("#field").mask("AAA"); ...

Unity | 'gameobject.renderer.material.color' in version 5.x

unity3d,shader,crop,mask,renderer

Make a global variable MeshRenderer renderer; Start() { renderer = gameObject.GetComponent<MeshRenderer>() as MeshRenderer; } now you can use renderer!...

Create three circle mask with canvas

javascript,html5,canvas,mask

You can add as many circles as you need, you must only indicate the position and the desired radius: JS: var context = document.getElementById('canvas').getContext('2d'); // Color of the "mask" context.fillStyle = '#000'; // Rectangle with the proportions of the image (600x400) context.fillRect(0,0,600,400); /** * @param x Specifies the x-coordinate *...

.htaccess mask /folder/subfolder to /folder/ contents but keeping url same

.htaccess,url,folder,mask,subfolder

Inside /folder/.htaccess have this code: RewriteEngine On RewriteBase /folder/ RewriteRule ^subfolder/(.*)$ $1 [L,NC] ...

Using mask to show/hide a view with animation

ios,ios8,calayer,mask,bounds

You're changing the bounds of the mask, but not the path. You really need to change the path of the mask. You theoretically can do that with CABasicAnimation, but I personally find that pretty flaky when animating paths (especially those of a mask). If you can, I'd retire the mask...

Texturing drawn shapes - python pygame

python,pygame,textures,transparency,mask

One option, of course, would be to re-implement the "bucket fill" algorithm yourself, and copy pixels inside the polygon. That would be a lot of work, and wouldget slow done in pure Python - still, it would launch you into the basic foundations of image manipulation http://en.wikipedia.org/wiki/Flood_fill Since Pygame already...

Input mask in MS Access, uppercase and lowercase letters

ms-access,text,input,mask,typing

Input masks in Access are a bit limited. You'll have to get down to VBA to get what you want. For instance: Private Sub txtbox_KeyPress(KeyAscii As Integer) ' Convert the typed key to upper case KeyAscii = Asc(UCase$(Chr$(KeyAscii))) ' Only Allow user to type letters A-E and 1-6 If KeyAscii...

Using a UIButton to mask a moving UIView

ios,objective-c,uibutton,mask

My understanding is that you have a view, then you want to transition between its two subviews with a sliding animation. This is fairly straight forward. First set "Clip Subviews" to true (either in storyboard editor or setting view.clipToBounds=true). If you want a sphere like you show then set layer.cornerRadius...

SVG Mask Transparent Circle - Show only text without yellow background

javascript,html,image,svg,mask

Stick the original image behind everything. Note how I've adjusted your getElementsByTagName to fit because I'm lazy but it would be better if you gave the image you want to select an id and converted to getElementById. var img = document.getElementsByTagName("image")[2]; var imgPos = img.getBoundingClientRect(); var imgX = imgPos.left; var...

Python - parallelize a python loop for 2D masked array?

python,loops,numpy,parallel-processing,mask

I think you want to 'vectorize', to use numpy terminology, not parallelize in the multiprocess way. Your calculation is essentially a dot (matrix) product. Apply the mask once to the whole array to get a 2d array, NIJ. Its shape will be (N,5), where N is the number of True...

Mask & Unmask websocket data in python

python,websocket,mask

I found an really helpful script that did exactly what i needed. http://sidekick.windforwings.com/2013/03/minimal-websocket-broadcast-server-in.html ...

Create mask from color Image in C++ (Superimposing a colored image mask)

c++,algorithm,opencv,image-processing,mask

1. Custom version I would write it explicitly: const int cols = drawing.cols; const int rows = drawing.rows; for (int j = 0; j < rows; j++) { const uint8_t* p_draw = drawing.ptr(j); //Take a pointer to j-th row of the image to be drawn uint8_t* p_dest = webcam_img.ptr(j); //Take...

Getting positions of specific values of a 2D NumPy array with mask

python,arrays,coordinates,mask

np.ma.where respects the mask -- it does not return indices in the condition (e.g. m < 5000.) that are masked. In [58]: np.asarray(np.column_stack(np.ma.where(m < 5000.))) Out[58]: array([[0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [2, 0], [2, 1], [3, 0], [3, 2]]) Compare that with the analogous expression...

Swift: Mask Alignment + Auto-Layout Constraints

swift,calayer,mask

I found a way around it. Not sure if this is the best way but here we go... http://imgur.com/pUIZbNA Just make sure you change the name of the UIView class in the storyboard inspector too. Apparently, the trick is to set the mask frame for each layoutSubviews call. class MaskView...

Converting subsripts and indices

matlab,indexing,mask,subscript,roi

There are a couple of things wrong in your approach. To detail I'll use a slightly smaller sample data set, but the explanation can scale up to any size. Y = randi(10,5,5,3)-5 ; This create a 5x5x3 containing random integers numbers from -5 to 5 (so a good chance to...

trouble using a mask to manipulate a bit

c,bit-manipulation,mask

In your funciton, temp is just redundant, and maskco always have the top bits set, so it won't work if x is a positive number The simple solution is masking out the most significant bits int fit_in_n_bits(int x, int n) { int maskabs = x >> sizeof(int) * CHAR_BIT -...

Mask CALayer with Another CALayer

ios,xcode,swift,calayer,mask

The problem is with frame calculation of the mask. Make sure that when some of the layer is a mask then you should calculate the frame of the mask like if it is just a sublayer of the superlayer. In other words, the coordinate system of the mask equals to...

Getting masked area to be transparent?

c++,opencv,transparent,image-manipulation,mask

This can be done by first setting its alpha value to 0 of the regions that you want to make them fully transparent (255 for others), and then save it to PNG. To set the alpha value of pixel-(x,y), it can be done: image.at<cv::Vec4b>(y, x)[3] = 0; PS: you need...

How to mask keyboard interrupt using IMR in 8086?

keyboard,interrupt,mask,8086

No, if you want to mask an IRQ line you have to set the bit. Writing a Zero would unmask it and enable it. I am guessing since this is in the 8086 section you want to control an 8259-compatible basic PIC, and not an APIC. Assuming the PIC is...

OpenCV Binary Image Mask for Image Analysis in C++

c++,opencv,image-processing,mask,threshold

//First load your source image, here load as gray scale cv::Mat srcImage = cv::imread("sourceImage.jpg", CV_LOAD_IMAGE_GRAYSCALE); //Then define your mask image cv::Mat mask = cv::Mat::zeros(srcImage.size(), srcImage.type()); //Define your destination image cv::Mat dstImage = cv::Mat::zeros(srcImage.size(), srcImage.type()); //I assume you want to draw the circle at the center of your image, with a...

Applying circular mask with periodic boundary conditions in python

python,numpy,mask,circular

One way could just be to create the mask of required size in the center of the array and then use np.roll to shift the mask along an axis (this causes the mask to wrap around the edges of the array). Following the method in the linked question and answer:...

Tricks for catching & and && misuse in C?

c++,c,binary,mask

In C++, and and bitand are alternatives for && and & respectively (You can find all the alternatives on cppreference). #include <iostream> int main() { std::cout << std::boolalpha << (42 and 0x0123) << std::endl; std::cout << std::boolalpha << (42 bitand 0x0123) << std::endl; return 0; } Live on Coliru (Thanks...

Pentaho convert string to integer with decimal point

string,format,pentaho,mask,kettle

Have you tried another step the reach your goal? You can try to use e.g. User Defined Java Expression setting it in this way: Java expression: new java.math.BigDecimal(text.substring(0,4) + "." + text.substring(4,text.length())) Value type: BigNumber But this will convert your input to: 00289 --> 28.9 01109 --> 110.9 003201 -->...

How can masking not work in ActionScript 3?

actionscript-3,mask

//this wasthe problem in my big project maskSprite.z = 0; // avoid this with masks Just a wild guess from me:if you use the properties z, rotationX, rotationY, rotationZ (maybe some more) the sprite is shifted to the 3D space and the masking is only working in 2D. I have...

How to modify a model(ng-model value) specified behind a directive in angularjs?

javascript,angularjs,angularjs-directive,mask

Your directive has its own scope (because you defined it), its a different scope from a controllers scope (aka $scope). So $scope.inputValue doesnt reffer to anything in the controller. There are ways to do what you want to do (like binding it through an aditional attribute for example), but I...

masking a double over a string

string,matlab,double,mask

There are so many ways you can accomplish this task. I'll give you two. Method #1 - Generate linear indices and access elements Use sub2ind to generate a set of linear indices that correspond to the row and column locations you want to access in your matrix. You'll note that...

Avoid hit area on link masked with css mask

css,css3,mask,masking

CSS masking is still an experimental feature. I don't know how to fix your issue and can only provide a work around. A possible way to get your desired result is to use svg with the clipPath element to clip your links. Example : svg{ width:90%; border:1px solid red; }...

Faster way to apply a bit mask while working with strings and shorts?

c#,mask,bit

If I understand correctly, what you are really saying is that the method should return true if and only if each bit in the wordToMask value is set in the corresponding location where the same bit is set in the mask, with the qualification that the mask value should be...

firefox 35.0.1: svg mask animation doesn't work

firefox,animation,svg,mask,snap.svg

It was caused by a change in the Firefox code which was not completely correct and which was then fixed. Bug 932771 caused it and bug 1127507 which was backported as far as Firefox 36 fixed it.

Create an mask on an UIView to colorise all UIImageView subviews in black and white

ios,objective-c,uiview,uiimageview,mask

No, you can't create a mask that will convert images to B&W. What you CAN do is to write code that uses a Core Image Filter to convert the images to B&W. You could use the "CIColorMonochrome" filter with an inputIntensity value 0 1, you could use "CIPhotoEffectMono", or you...

OpenCV & Python: quickly superimpose mask over image without overflow

python,opencv,numpy,mask

There might be better ways of applying a colorizing mask to an image, but if you want to do it the way you suggest, then this simple clipping will do what you want: import numpy as np image[:, :, 0] = np.clip(image[:, :, 0] + color_delta[0] * (mask[:, :, 0]...

How to create rotated rectangular or polygonal ROI/mask?

c++,opencv,mask,threshold,roi

The idea is to use fillPoly() to fill all the pixels inside the rotated-rectangle/polygon to 0, 255 otherwise: Mat mask = cv::Mat(img.size(), CV_8UC1, Scalar(255)); // suppose img is your image Mat vector<vector<Point>> pts = { { pt1, pt2, pt3, pt4 } }; fillPoly(mask, pts, Scalar(0)); // <- do it here...

Create mask from bwtraceboundary in Matlab

image,matlab,image-processing,mask,boundary

It's very simple. I actually wouldn't use the code above and use the image processing toolbox instead. There's a built-in function to remove any white pixels that touch the border of the image. Use the imclearborder function. The function will return a new binary image where any pixels that were...

Subtract UIView from another UIView in Swift

ios,swift,calayer,mask

There might be another drawing solution but basically you have 4 areas that need to be handled. Take the square area above and below the space with full width and add the right and left side between them with constraints to eachother.

SVG working on html image tag — not on HTML5 canvas

css,html5,svg,mask,svg-filters

I researched and found that HTML5 Canvas radial gradient was an effective solution. var lightSize = 100; var x = 200; var y = 200; var radialGradient = context.createRadialGradient(x, y, 0,x, y, lightSize); radialGradient.addColorStop(0, "#FFFF99"); // color at start circle radialGradient.addColorStop(0.9, "#FFFF99"); //color at offset 0.9 radialGradient.addColorStop(1, '#7D7D5C');// color of...

How to make SVG “fill” act in a similar way to CSS “background-size: cover”

image,svg,mask

To fix this, add an appropriate preserveAspectRatio attribute to the <image> in your <pattern> to tell it that you want the image to be zoomed and sliced. <pattern id="image" patternUnits="userSpaceOnUse" width="83.38" height="100" x="0" y="0"> <image xlink:href="http://goo.gl/kVVuy1" x="0" y="0" width="100%" height="100%" preserveAspectRatio="xMinYMin slice"/> </pattern> Demo here...

Transparent Border showing background image

css,css3,border,mask,css-shapes

You can achieve the transparent border using a pseudo element. The red background is the border of the pseudo element and the transparent border is created by the gap between the element's background and the pseudo element's border: DEMO body{ background:url('http://lorempixel.com/output/people-q-c-640-480-9.jpg'); background-size:cover; } .big{ margin:50px; padding:50px; min-height:500px; overflow:hidden; } .big...

how to mask data fields in mysql?

php,mysql,mask

Assuming the column name is phone, this SQL statement will do: SELECT CONCAT(SUBSTR(phone, 1, 6), REPEAT('*', CHAR_LENGTH(phone) - 6)) AS masked_phone FROM `yourTable` This will only show the first 6 characters and will mask the rest with *. Update (as per your comment): Upon backup, you could generate the following...

Create an image-overlay mask in javafx

image,javafx,imageview,overlay,mask

What you are Doing Wrong The difference operator isn't a binary difference based on whether a pixel is set instead it is a difference in the RGB components, so instead of a solid red overlay, you will get a multi-colored overlay because the difference in the RGB components of the...

How Swiffy antialias canvas?

javascript,canvas,mask,antialiasing,google-swiffy

Instead of using clip() you can draw the clipping path into an off-screen canvas and use that as a "matte", or rather, an alpha mask. Now you can use the mask with various composite modes to get anti-aliased edges. Draw in the background you want to clip, set a composite...

CSS3 transparent mask

html,css,css3,transparent,mask

The solution: Replace one of the borders (eg. border-right) with a transparent colour This will give a three quarter wheel. To get less than this use the :after property to create another three quarter wheel and then CSS3 transform to rotate it to the desired angle. .wheel { position: absolute;...

DevExpress TextEditSettings with decimal? (Culture indipendent)

c#,wpf,devexpress,mask

We have a grid control with the following properties for the EditSettings: Mask="n" MaskType="Numeric" MaskUseAsDisplayFormat="True" Maybe it will help you....

actionscript 3.0 visible mask over a visible masked object

actionscript-3,mask

You DON'T want to mask the truck. What you want to mask are the city lights. You need to create a copy of the truck, and mask the city lights with that. Assuming you have a Bitmap in your library with exported class as TruckImage and your lights are exported...

Input Mask with angular-input-masks

angularjs,angular-ui,declaration,mask,angularjs-ui-utils

Declare module like below. angular.module('app',['ui.utils.masks']) And then change ng-app on HTML like below. ng-app="app" This would help you. Thanks....

Create mask from QImage using non-transparent pixels

python,qt,pyqt,mask,alpha

Instead of a QImage, I used a QPixmap. This allowed me to call the function mask, which provided me with the QBitMap I desired: QPixmap(imagePath).mask() ...

Android View/Layout Masking

android,relativelayout,mask

There isn't a direct API in the framework that allows you to trace a solid image mask and generate a Path that you can use to do clipping. If you can access the mask contents as SVG, you might be able to use the path tracing techniques Romain Guy describes...

I need to mask the incoming number and show only last 4 digits?

javascript,jquery,datatables,mask

This will display a 'Show' link in the table cell: 'mRender': function (data, type, full) { return '<span class=\'hidden\'>' + full[0].substring(full[0].length - 4) + '</span>' + '<a href=\'javascript:;\' class=\'hidden\' id=\'hide\'>Hide</a>' + '<a href=\'javascript:;\' id=\'show\'>Show</a>'; } javascript click event to handle the show/hide $(document).on("click", "a.show", function (e) { // get the...

Swift Progress Indicator Image Mask

ios,swift,mask,progress

Masking is probably overkill for this. Just redraw the image each time. When you do, you draw the red rectangle to fill the lower half of the drawing, to whatever height you want it; then you draw the droplet image (a PNG), which has transparency in the middle so the...

SpriteKit SKCropNode Masks everything

objective-c,ios8,sprite-kit,mask,skcropnode

I am guessing that the image as shown below is your designated background. Have you checked your nodes zPosition? If you want to show your spaceship infront of your background, you will have to adjust the zPosition to be higher than that of the background sprite....

AS3 Draggable layer/mask on y axis

image,actionscript-3,draggable,mask,movieclip

The documentation of startDrag() tells you about a second optional parameter bounds: bounds:Rectangle (default = null) — Value relative to the coordinates of the Sprite's parent that specify a constraint rectangle for the Sprite. The y axis is a rectangle with zero width. In order to drag both the handle...

Most browser-supported method to change the color of a simple PNG image?

html,css,svg,mask

Answer & Demo I've solved the problem, here is a JSFiddle. Pros It's very easy to use. You can select any color in any format known to JavaScript. Your icon can have any color except white. Cons In order to be compatible with all the color formats, it needs the...

Byte Pattern Finding (Needle in Haystack) - Wildcard/Mask?

c#,arrays,byte,wildcard,mask

Modifying your code to support wildcards is easy enough. Making it efficient for searching in large bodies of data will probably require a more sophisticated algorithm, like Boyer-Moore with wildcards (sorry, I don't have the code lying around). Here's one way of doing the former (off the top of my...

Fill image with texture/pattern

javascript,canvas,html5-canvas,drawing,mask

If you're just after an illustrative approximation you can use a combination of blending and composition modes. First thing is to make sure your main image has transparency - this is important for composition to work (I made a rough cut-off in the following demo). Main steps: Draw the pattern...