Android Drop Shadow on View

You could use a combination of Bitmap.extractAlpha and a BlurMaskFilter to manually create a drop shadow for any image you need to display, but that would only work if your image is only loaded/displayed once in a while, since the process is expensive. Pseudo-code (might even compile!): BlurMaskFilter blurFilter = new BlurMaskFilter(5, BlurMaskFilter.Blur.OUTER); Paint shadowPaint … Read more

JavaFX effect on background

import javafx.animation.*; import javafx.application.*; import javafx.beans.property.*; import javafx.embed.swing.SwingFXUtils; import javafx.geometry.Insets; import javafx.scene.*; import javafx.scene.control.Label; import javafx.scene.effect.*; import javafx.scene.Cursor; import javafx.scene.Node; import javafx.scene.image.*; import javafx.scene.layout.StackPane; import javafx.scene.paint.Color; import javafx.stage.Stage; import javafx.stage.StageStyle; import javafx.util.Duration; public class FrostyTech extends Application { private static final double BLUR_AMOUNT = 10; private static final Effect frostEffect = new BoxBlur(BLUR_AMOUNT, BLUR_AMOUNT, 3); … Read more

CSS Speech Bubble with Box Shadow

Instead of using a triangle hack, you can just rotate a div using transform and get a real box-shadow. Since you only want the shadow on one side of the div (the visible triangle side), you have to make the blur smaller and lower the opacity. Demo: http://jsfiddle.net/ThinkingStiff/mek5Z/ HTML: <div class=”bubble”></div> CSS: .bubble{ background-color: #F2F2F2; … Read more

DropShadow for WPF Borderless Window

I have written a little utility class that is able to do exactly what you want: drop a standard shadow over a borderless Window but having AllowsTransparency set to false. You just have to call the DropShadowToWindow(Window window) method. It is preferred that you make this call just after the window’s constructor’s InitializeComponent(), but it … Read more

Android View shadow

I know this question has already been answered but I want you to know that I found a drawable on Android Studio that is very similar to the pics you have in the question: Take a look at this: android:background=”@drawable/abc_menu_dropdown_panel_holo_light” It looks like this: Hope it will be helpful Edit The option above is for … Read more

Custom ImageView with drop shadow

Okay, I don’t foresee any more answers on this one, so what I ended up going with for now is just a solution for rectangular images. I’ve used the following NinePatch: along with the appropriate padding in XML: <ImageView android:id=”@+id/image_test” android:background=”@drawable/drop_shadow” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:paddingLeft=”6px” android:paddingTop=”4px” android:paddingRight=”8px” android:paddingBottom=”9px” android:src=”https://stackoverflow.com/questions/3693234/@drawable/pic1″ /> to get a fairly good result: … Read more