clipping

complex clipping boundary in kinetic.js with draggable image

谁说我不能喝 提交于 2019-12-24 04:11:30
问题 Check out my html5 based clipping constraint on http://shedlimited.debrucellc.com/test3/canvaskinclip.html (messing with jsfiddle on http://jsfiddle.net/aqaP7/4/) So, in html5 I can easily draw a shaped boundary like the following: context.beginPath(); context.moveTo(5, 5); context.lineTo(34, 202); context.lineTo(2, 405); context.lineTo(212, 385); context.lineTo(425, 405); context.lineTo(400, 202); context.lineTo(415, 10); context.lineTo(212, 25); context.clip(); In kinetic.js though, all I

Circle shape clipping with opengl-es in cocos2d

雨燕双飞 提交于 2019-12-24 01:18:00
问题 I'm trying to make a circle shape clipping on a CCSprite in cocos2d, after searching a lot, i tried the open gl glScissor method, i achieve an squared clipping over my sprite. But, i need to make it a circle, and it seems to be impossible to do with the glScissor. I kept trying and I found something about gl stencil, but I haven't found a how to on this and I'm not familiar with opengl. Also I heard something about calling multiple times to the glScissor wo you can achieve a custom shape but

Rotate Bitmap (Rectangle) While Maintining Area

徘徊边缘 提交于 2019-12-22 18:39:09
问题 How can I rotate an Bitmap a given number of degrees while maintaining the area of the original bitmap. ie, what I rotate a bitmap of Width:100,Height:200, my end result will be a bigger image but the rotated portion will still have an area of 100*200 回答1: The graphics transform function is perfect for this. Create a new bitmap of the size you want, create a graphics object based off that bitmap, apply the transform then draw onto the canvas (graphics.drawimage(original_image)). Here is a

CSS Polygon Shadow

ぐ巨炮叔叔 提交于 2019-12-22 06:49:05
问题 I'm using the clip-path property to shape my block element. clip-path: polygon(0 0, 100% 0, 100% 100px, 50% 100%, 0 100px); I would like to put a "drop shadow" in that element. So, I've tried some techniques, like: box-shadow: 0 15px 30px 0 rgba(0, 0, 0, 0.5); Or... filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.5)); See my test environment on CodePen. Is it possible with CSS or SVG? 回答1: As it was said in the comments, you need 2 nested elements for this, the inner for the clipping and the

Greiner-Hormann clipping with degeneracies

折月煮酒 提交于 2019-12-22 01:19:38
问题 I'm trying to understand the paper "Clipping of Arbitrary Polygons with Degeneracies" by E. L Foster and J. R. Overfelt [1], which claims to extend the classic Greiner-Hormann polygon clipping algorithm by handling of degeneracies. However, I ran into some difficulties with the procedure they describe. Consider the situation depicted on Figure 6(c) and suppose the polygons are oriented in the same way. Start the labeling phase from the I5 (as opposed from I1, as they do): for both subject

Silverlight: Canvas overflows

不羁岁月 提交于 2019-12-21 09:34:30
问题 I have created a Canvas, and within it I placed a StackPanel. The StackPanel is horizontal, and it accepts a list of thumbnailed images. The Canvas has a fixed size. When I put more thumbnails than the Canvas width can hold, the StackPanel is supposed to overflow from the Canvas, so I can move it to center the current thumbnail. Everything works correctly, only, the StackPanel's overflow is visible! Is there a way to hide it? Or is the entire approach wrong? Here is a screenshot. The canvas

How to invert clipping geometry in Silverlight/WPF?

和自甴很熟 提交于 2019-12-21 07:22:29
问题 The UIElement.Clip property takes a Geometry object and uses it to clip away the outside of the UIElement . I would like to do the geometric inverse and punch a hole into the element instead. Anyone know how to do this? I imagine creating an inverted version of the clip geometry would work, but I can't find a way to do this. EDIT It seems that WPF has Geometry.Combine which can be used to subtract one geometry from another, though this isn't available in Silverlight. If it were, I could

How to invert clipping geometry in Silverlight/WPF?

巧了我就是萌 提交于 2019-12-21 07:21:03
问题 The UIElement.Clip property takes a Geometry object and uses it to clip away the outside of the UIElement . I would like to do the geometric inverse and punch a hole into the element instead. Anyone know how to do this? I imagine creating an inverted version of the clip geometry would work, but I can't find a way to do this. EDIT It seems that WPF has Geometry.Combine which can be used to subtract one geometry from another, though this isn't available in Silverlight. If it were, I could

CGContextClipToMask returning blank image

佐手、 提交于 2019-12-21 04:12:08
问题 I'm new to Quartz. I have 2 images, a background, and a mask with cutout shape that I want to lay over the background in order to cut out a section. The resulting image should be the shape of the cutout. This is my mask (the shape in the middle is 0 alpha): And this is my code: UIView *canvas = [[[sender superview] subviews] objectAtIndex:0]; UIGraphicsBeginImageContext(canvas.bounds.size); CGColorSpaceRef colourSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef cgContext =

Internet Explorer CSS property “filter” ignores overflow:visible

余生颓废 提交于 2019-12-21 03:41:16
问题 Apparently Internet Explorer (up to version 8 at least) ignores overflow:visible when applying filter (e.g. for opacity), causing anything outside the filtered element to be clipped as if overflow:hidden were used. Are there any workarounds to this behavior ? The sample code below shows how child is clipped by container – only its right and bottom borders are visible. <style type="text/css"> #container { position:absolute; left:100px; top:100px; width:100px; height:100px; border:1px solid