clipping

Rounded rect on NSView that clips all containing subviews

ε祈祈猫儿з 提交于 2019-12-20 17:41:12
问题 I am creating a NSView subclass that has rounded corners. This view is meant to be a container and other subviews will be added to it. I am trying to get the rounded corners of the NSView to clip all of the subview's corners as well, but am not able to get it. - (void)drawRect:(NSRect)dirtyRect { NSRect rect = [self bounds]; NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:self.radius yRadius:self.radius]; [path addClip]; [[NSColor redColor] set]; NSRectFill(dirtyRect

Rounded rect on NSView that clips all containing subviews

百般思念 提交于 2019-12-20 17:40:03
问题 I am creating a NSView subclass that has rounded corners. This view is meant to be a container and other subviews will be added to it. I am trying to get the rounded corners of the NSView to clip all of the subview's corners as well, but am not able to get it. - (void)drawRect:(NSRect)dirtyRect { NSRect rect = [self bounds]; NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:rect xRadius:self.radius yRadius:self.radius]; [path addClip]; [[NSColor redColor] set]; NSRectFill(dirtyRect

libgdx Cutting an image

匆匆过客 提交于 2019-12-20 04:30:47
问题 I have been trying to "cut" an image for some time now, I ll explain why and what I tried. So I wanted to create an hp "bar" except it's not a bar but a heart and so I though it would be easy all I had to do is have two pictures draw them on top of each other and then just cut one to make it appear as in hp was being lost, but I was not able to find a way to cut the image. Setting the height just resizes the image as you might have guessed I tried using textureRegion to kind of hack it but it

Displaying wpf content over/outside main window bounds [closed]

只愿长相守 提交于 2019-12-19 18:33:32
问题 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 am trying to achieve an effect of overlapping the main window boundary with a control. It's hard to explain this in words which is also maybe why I am having difficulty finding information on how to do this or if it is even possible. Below is an example of the effect I am trying to get (from the designer),

Displaying wpf content over/outside main window bounds [closed]

坚强是说给别人听的谎言 提交于 2019-12-19 18:33:12
问题 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 am trying to achieve an effect of overlapping the main window boundary with a control. It's hard to explain this in words which is also maybe why I am having difficulty finding information on how to do this or if it is even possible. Below is an example of the effect I am trying to get (from the designer),

RectangleGeometry with relative dimensions… how?

↘锁芯ラ 提交于 2019-12-19 17:00:03
问题 I'm trying to replicate the nowadays so fashionable "reflex" effect on a controltemplate for buttons I'm creating. The basic idea is to create a rectangle with a gradient fill from white to transparent and then clip some of that semi-transparent rectangle with a rectanglegeometry. The problem is that I don't know how to define a relative rectangle geometry. I kind of worked around width by defining a large value (1000), but height is a problem. For example, it works good for buttons that have

RectangleGeometry with relative dimensions… how?

限于喜欢 提交于 2019-12-19 16:59:14
问题 I'm trying to replicate the nowadays so fashionable "reflex" effect on a controltemplate for buttons I'm creating. The basic idea is to create a rectangle with a gradient fill from white to transparent and then clip some of that semi-transparent rectangle with a rectanglegeometry. The problem is that I don't know how to define a relative rectangle geometry. I kind of worked around width by defining a large value (1000), but height is a problem. For example, it works good for buttons that have

RectangleGeometry with relative dimensions… how?

醉酒当歌 提交于 2019-12-19 16:59:10
问题 I'm trying to replicate the nowadays so fashionable "reflex" effect on a controltemplate for buttons I'm creating. The basic idea is to create a rectangle with a gradient fill from white to transparent and then clip some of that semi-transparent rectangle with a rectanglegeometry. The problem is that I don't know how to define a relative rectangle geometry. I kind of worked around width by defining a large value (1000), but height is a problem. For example, it works good for buttons that have

Understanding Android Canvas Clipping

柔情痞子 提交于 2019-12-19 08:13:34
问题 I am having trouble finding an answer to this. Consider the clipping code below: boolean is_ok = mycanvas.clipRect(clip_left, clip_top, clip_right+1, clip_bottom+1); mycanvas.getClipBounds(clipRect); if (!is_ok || clipRect.left != clip_left || clipRect.top != clip_top || clipRect.right != clip_right+1 || clipRect.bottom != clip_bottom+1) { Log.i("DEBUG", "setClipping failed"); } When the clip bounds are returned they don't match what was just set. For example if clip_left, clip_top, clip

Possible to have anti-aliasing when drawing a clipped image?

荒凉一梦 提交于 2019-12-18 05:55:22
问题 Currently, I'm successfully using the Graphics class to draw a non-rectangular clipped image (the turtle inside): My code looks something like: using (var g = Graphics.FromImage(image)) { g.InterpolationMode = InterpolationMode.HighQualityBicubic; using (var gfxPath = new GraphicsPath()) { gfxPath.AddEllipse(r); using (var region = new Region(r)) { region.Exclude(gfxPath); g.ExcludeClip(region); g.DrawImage(turtleImage, r, r2, GraphicsUnit.Pixel); } } } This all works just as expected. What I