dropshadow

Android XML: Drop shadow cut off

冷暖自知 提交于 2019-12-04 23:55:20
I have a relative layout with a margin and a floating action button that is nested inside this layout. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_margin="@dimen/activityMargin" android:orientation="vertical" android:clipToPadding="false"> <android.support.design.widget.FloatingActionButton android:id="@+id/id_FABSave" android:layout_width="wrap_content" android:layout_height="wrap

Styling Bars and Lines with Chart.js

こ雲淡風輕ζ 提交于 2019-12-04 12:18:35
问题 We have been using Chart.js for several months now and like the power it gives us with ease of programming. One of the things we would like to start adding to the charts produced from Chart.js is a little nicer styling of the charts we generate. Most of the charts we are using are bar charts, with a few line charts thrown in. When I use the term "styling" what I am really talking about is making the bars or lines look a little nicer. Specifically I would like to add a drop shadow behind the

How to add shadow on custom text?

微笑、不失礼 提交于 2019-12-04 11:16:02
i tried with xml file and with code to add shadow to custom font without any success my code is TextView text=(TextView)findViewById(R.id.text1); Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/gillsans.ttf"); text.setTypeface(tf); use this: Activity.class : TextView text=(TextView)findViewById(R.id.text1); Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/gillsans.ttf"); text.setTypeface(tf); //////////// Shader textShader=new LinearGradient(2, 0, 4, 60, new int[]{Color.parseColor("#b4e391"),Color.parseColor("#61c419"),Color.parseColor("#b4e391")}, new float[]{0, 3,1},

CSS3-like box shadow implementation / algorithm

青春壹個敷衍的年華 提交于 2019-12-04 09:05:10
I am looking for or trying to implement an algorithm to draw box shadows (as in the CSS 3 specifiction) which accepts the following parameters: Horizontal Offset Vertical Offset Inset Spread Blur Color (Optional: Opacity). Where to start. I have looked for Firefox / Chrome source code to see if I can pull an implementation from there, no such luck! I have looked into linear gradient algorithms, drawing them with a box, which kind of works, except with rounded rectangles it leaves empty pixels in the shadow, presumably due to the radius of the edge. I am doing this in .NET with GDI+. My aim is

WPF: Why does text and elements blur if I use dropshadow effect on a parent item

一个人想着一个人 提交于 2019-12-04 08:57:55
问题 If I add a DropShadowEffect to an parent element the text of the child elements are blurred. Why? <Grid> <Grid.Effect> <DropShadowEffect /> </Grid.Effect> <Grid.ColumnDefinitions> <ColumnDefinition /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition /> </Grid.RowDefinitions> <TextBlock Background="White">Test</TextBlock> </Grid> Update: with shadow without shadow 回答1: The reason why the text is blurred is because Effects cause the elements and all sub-elements to be rendered

Android ImageView drop shadow

烈酒焚心 提交于 2019-12-03 17:24:56
问题 I'm trying to add a drop shadow to an ImageView. The other Stackoverflow answer seems to be using canvas and bitmaps etc, way more complicated than it needs to be. On iOS I would do something like this: myImageView.layer.shadowColor = [UIColor redColor].CGColor; myImageView.layer.shadowRadius = 5; myImageView.layer.shadowOffset = CGRectMake(0, 5); and it would render a drop shadow, regardless of whether the shadow is being applied on a view, an image or text. I've tried to do the same on

Android ImageView drop shadow

只谈情不闲聊 提交于 2019-12-03 12:27:09
I'm trying to add a drop shadow to an ImageView. The other Stackoverflow answer seems to be using canvas and bitmaps etc, way more complicated than it needs to be. On iOS I would do something like this: myImageView.layer.shadowColor = [UIColor redColor].CGColor; myImageView.layer.shadowRadius = 5; myImageView.layer.shadowOffset = CGRectMake(0, 5); and it would render a drop shadow, regardless of whether the shadow is being applied on a view, an image or text. I've tried to do the same on Android but it just refuses to work: birdImageView = new ImageView(context); birdImageView.setImageResource

Styling Bars and Lines with Chart.js

夙愿已清 提交于 2019-12-03 07:40:52
We have been using Chart.js for several months now and like the power it gives us with ease of programming. One of the things we would like to start adding to the charts produced from Chart.js is a little nicer styling of the charts we generate. Most of the charts we are using are bar charts, with a few line charts thrown in. When I use the term "styling" what I am really talking about is making the bars or lines look a little nicer. Specifically I would like to add a drop shadow behind the bar and line charts, and maybe even a bevel to the bars. I've looked through many questions, and can't

How can I add a drop-shadow to an image using PHP?

怎甘沉沦 提交于 2019-12-03 05:39:36
I am looking for a way to add a drop shadow to an image using PHP. Before you answer or vote to close: I am not looking to do this using CSS or HTML. I want to generate an image file. This is not a duplicate of this question nor this one . I am looking for a very specific effect . For example, given this input image: I want to produce the following image: TL;DR: This image above was generated using Photoshop's Drop Shadow effect. I want a look very similar to that. For reference, here's the settings our design team used. Ideally, I'd have similar control in my code for angle, distance, opacity

WPF: Why does text and elements blur if I use dropshadow effect on a parent item

泄露秘密 提交于 2019-12-03 01:28:51
If I add a DropShadowEffect to an parent element the text of the child elements are blurred. Why? <Grid> <Grid.Effect> <DropShadowEffect /> </Grid.Effect> <Grid.ColumnDefinitions> <ColumnDefinition /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition /> </Grid.RowDefinitions> <TextBlock Background="White">Test</TextBlock> </Grid> Update: with shadow without shadow The reason why the text is blurred is because Effects cause the elements and all sub-elements to be rendered into a Bitmap first. This means that sub-pixel rendering (ClearType) cannot take place and therefore the text