clip

Android View Clipping

亡梦爱人 提交于 2019-11-27 03:32:42
Is there any way to define the clip region of a ViewGroup in android (Honeycomb)? For example, I have a ListView with an image background that has rounded corners. As I scroll through the list, the children stick out past the corners of the background - I would prefer them to clip within the rounded corners. The left image is what it is currently doing, and the right is what I'd like. I was looking at ClipDrawable, but it seems that this may only be used for progress bars? Also, I'm trying to do this in a widget. So I cannot use a custom view and override onDraw for masking. Thank you! Try

Java play multiple Clips simultaneously

久未见 提交于 2019-11-26 18:30:16
问题 So my application should play the WAV file every time I click on the panel. But the problem right now is, it waits for the first one to finish before it plays the second one. I want to be able to have them play simultaneously. The reason I put Thread.sleep(500) is because if I don't, then it won't play the sound at all :( import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import javax

How to anti-alias clip() edges in html5 canvas under Chrome Windows?

馋奶兔 提交于 2019-11-26 15:54:31
问题 I'm using the clip() function on a canvas. Results: As you can see the chrome version has horrible jaggies / aliasing along the edges. How do I fix this? Code to reproduce: http://jsfiddle.net/ZRA76/ : <canvas id="test" width="300" height="300"></canvas>​ <script type="text/javascript"> cv = document.getElementById("test"); ctx = cv.getContext("2d"); var im = new Image(); im.onload = function () { ctx.beginPath(); ctx.arc(110, 110, 100, 0, 2*Math.PI, true); ctx.clip(); ctx.drawImage(im, 0, 0)

Android View Clipping

我怕爱的太早我们不能终老 提交于 2019-11-26 10:31:04
问题 Is there any way to define the clip region of a ViewGroup in android (Honeycomb)? For example, I have a ListView with an image background that has rounded corners. As I scroll through the list, the children stick out past the corners of the background - I would prefer them to clip within the rounded corners. The left image is what it is currently doing, and the right is what I\'d like. I was looking at ClipDrawable, but it seems that this may only be used for progress bars? Also, I\'m trying

Playing multiple sound clips using Clip objects

北战南征 提交于 2019-11-26 10:02:31
问题 I am developing a program that has numerous JButton objects, and I want each one to correspond to its own .wav file. Also, I want the sounds to work in a way such that they can overlap with other buttons\' sounds, but it cannot overlap with itself (clicking a button while its sound is playing will restart the sound). I tried using a single Clip object but I had trouble accomplishing what I stated above. As a result, I resorted to declaring a new Clip object for each button, but I have a