clip

Clipping or chamfering corners of image to see background

拟墨画扇 提交于 2019-11-30 07:41:08
问题 I have a design where corners of images are cut in a 45° angle. For the time being, it’s achieved by masking it with an absolutely positioned span, which has a transparent background image set with the corner “cut” in opaque white. This is far from ideal, first because of the additional span, second because the background of the image is not homogeneous white. I intend to generate transparent PNGs later, but it would be more elegant and – considering the images are photographs – less bandwith

CSS box shadow on container div causes scrollbars

瘦欲@ 提交于 2019-11-30 05:19:47
I have a website with the following setup: <div id="container"> <div id="header"></div> <div id="content"></div> <div id="clearfooter"></div> </div> <div id="footer"></div> I use the clearfooter and a footer outside the container to keep the footer at the bottom of the page when there isn't enough content. My problem is that I would like to apply a box shadow on the container div in the following way: #container {width:960px; min-height:100%; margin:0px auto -32px auto; position:relative; padding:0px; background-color:#e6e6e6; -moz-box-shadow: -3px 0px 5px rgba(0,0,0,.8), 3px 0px 5px rgba(0,0

Clip div with SVG path

走远了吗. 提交于 2019-11-29 16:45:43
I have two overlapping divs and I am trying to achieve the following effect: In order to do that my logic is to get the two divs to overlap, create that shape with SVG inside the second div and use that shape to clip the second div and show what’s below it (the top div). I’m not sure if this is the best logic to follow to achieve this and if it is I’m not sure how to use the SVG to clip the HTML element. This is my HTML so far: <div class="banner_1"> </div> <div class="banner_2"> <svg viewBox="0 0 500 500" preserveAspectRatio="xMinYMin meet"> <path d="M0,20 C100,80 350,0 500,30 L500,00 L0,0 Z"

Problem with Javas Audio Clips on frequent playback of beep sounds

喜你入骨 提交于 2019-11-29 15:43:57
问题 I want to playback short beep sounds (WAV files) on success and error of a GUI triggered action. I came across javax.sound.sampled.Clip, which seemed to work. Here is the basic code I use: clip.stop(); clip.setFramePosition(0); clip.start(); This is executed after a button click triggers a database action. On success and error two different preloaded Clips are played. But on the production machine (an old PC running Kubuntu 10.4) after some time (around 400+ executions or 2-4 hours) the clip

Song plays first time but does not play once stopped : Clip in Java

有些话、适合烂在心里 提交于 2019-11-29 15:21:27
I am using Clip in java to play a song as follows: MR.clip= (Clip) AudioSystem.getLine(MR.info[docIdOfSelectedSong]); MR.clip.open(MR.sounds[docIdOfSelectedSong]); MR.clip.setMicrosecondPosition(5* 1000000); MR.clip.start(); where MR.sounds is an array of type AudioInputStream and MR.info is an array of type DataLine.info . When I press a button ,the above code is called to play the song. Moreover, I have another button to stop the song which calls the below code public static void stopSong(){ MR.clip.close(); } The problem is that when I play the song for the first time, the play and stop

Clipping or chamfering corners of image to see background

放肆的年华 提交于 2019-11-29 04:56:20
I have a design where corners of images are cut in a 45° angle. For the time being, it’s achieved by masking it with an absolutely positioned span, which has a transparent background image set with the corner “cut” in opaque white. This is far from ideal, first because of the additional span, second because the background of the image is not homogeneous white. I intend to generate transparent PNGs later, but it would be more elegant and – considering the images are photographs – less bandwith-intensive to use JPEGs and CSS. The new CSS mask property seemed promising, but as I understand it

How to distort an image to any quadrangle?

丶灬走出姿态 提交于 2019-11-29 04:36:20
Do any of you have an idea, how to distort an image in any quadrangle? I want to implement an image, which you can pull any corner in any direction, distorting the image. Anyone has an idea how to do that? I use and write stuff in android for a while now, but it does not seem like android has a function for that. I don't really feel like writing a new math library :). Greetings, Can Andrei Mankevich Looks like you need Canvas.drawBitmapMesh . There is a sample in Android SDK showing how to use it. You need to use Matrix for drawing your bitmap on Canvas . You can easily create such

CSS box shadow on container div causes scrollbars

孤街浪徒 提交于 2019-11-29 03:22:21
问题 I have a website with the following setup: <div id="container"> <div id="header"></div> <div id="content"></div> <div id="clearfooter"></div> </div> <div id="footer"></div> I use the clearfooter and a footer outside the container to keep the footer at the bottom of the page when there isn't enough content. My problem is that I would like to apply a box shadow on the container div in the following way: #container {width:960px; min-height:100%; margin:0px auto -32px auto; position:relative;

Spritesheet in Silverlight

梦想的初衷 提交于 2019-11-29 02:14:12
Does anyone have an example of using a spritesheet in Silverlight? I'd like to clip the image and, when a button is pressed, jump to the next frame. (If the user keeps tapping the button, it'll look like an animation). I've looked around but haven't found exactly what I'm looking for. Thanks for any help. The following will do exactly what you're looking for. You can use the Up ↑ and Down ↓ keys on your keyboard to navigate forwards and backwards through the animation. XAML <Rectangle x:Name="imgRect"> <Rectangle.Fill> <ImageBrush x:Name="imgBrush" ImageSource="walking_spritesheet.png" Stretch

Clipping raster using shapefile in R, but keeping the geometry of the shapefile

时光总嘲笑我的痴心妄想 提交于 2019-11-28 18:50:38
I am using {raster} to clip (or crop) a raster based on an irregular shapefile (the Amazon biome) but the output always has a rectangular extent. However, I need the output in the exact same geometry of the shapefile. Any tips? Cheers. library(raster) library(rgdal) myshp <- readOGR("Amazon.shp", layer="Amazon") e <- extent(myshp) myraster <- raster("Temperature.tif") myraster.crop <- crop(myraster, e, snap="out", filename="myoutput.tif") One option is to use raster::mask() library(maptools) ## For wrld_simpl library(raster) ## Example SpatialPolygonsDataFrame data(wrld_simpl) SPDF <- subset