SVG transparent background web

transparent is not part of the SVG specification, although many UAs such as Firefox do support it anyway. The SVG way would be to set the stroke to none, or alternatively set the stroke-opacity to 0. You also don’t set any value for fill on the <rect> element and the default is black. For a … Read more

ImageMagick extend canvas with transparent background

Use this instead: convert \ input.png \ -background none \ -gravity center \ -extent 100×100 \ output.png Note well: The order of the parameters is significant! (To convince yourself, just put -background none at the end of the parameters instead of the start…) Updated: Thanks to @jesmith who noticed that the commandline I originally provided … Read more

How to call getResources() from a class which has no context?

A Context is a handle to the system; it provides services like resolving resources, obtaining access to databases and preferences, and so on. It is an “interface” that allows access to application specific resources and class and information about application environment. Your activities and services also extend Context to they inherit all those methods to … Read more

Check if color is dark or light in Android

Android doesn’t provide it, you can implement a method to determine this. Here a method to do that: public boolean isColorDark(int color){ double darkness = 1-(0.299*Color.red(color) + 0.587*Color.green(color) + 0.114*Color.blue(color))/255; if(darkness<0.5){ return false; // It’s a light color }else{ return true; // It’s a dark color } }

Greyscale Background Css Images

Here you go: <html xmlns=”http://www.w3.org/1999/xhtml”> <head runat=”server”> <title>bluantinoo CSS Grayscale Bg Image Sample</title> <style type=”text/css”> div { border: 1px solid black; padding: 5px; margin: 5px; width: 600px; height: 600px; float: left; color: white; } .grayscale { background: url(yourimagehere.jpg); -moz-filter: url(“data:image/svg+xml;utf8,<svg xmlns=\’http://www.w3.org/2000/svg\’><filter id=\’grayscale\’><feColorMatrix type=\’matrix\’ values=\’0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 … Read more

Android: how to create a background from pattern?

Here is a really nice explanation: Put your “back.png” image on “drawable” folder. Then create a drawable “backrepeat.xml” like that: <?xml version=”1.0″ encoding=”utf-8″?> <bitmap xmlns:android=”http://schemas.android.com/apk/res/android” android:src=”https://stackoverflow.com/questions/1700099/@drawable/back” android:tileMode=”repeat” /> In your layout, add android:background=”@drawable/backrepeat”: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout android:id=”@+id/MainLayout” xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”fill_parent” android:layout_height=”fill_parent” android:orientation=”vertical” android:background=”@drawable/backrepeat”> </LinearLayout> As is the case with many Android good practices/handy tricks, it … Read more

android animation is not finished in onAnimationEnd

Here is the actual bug related to this issue http://code.google.com/p/android-misc-widgets/issues/detail?id=8 This basically states that the onAnimationEnd method doesn’t really work well when an AnimationListener is attached to an Animation The workaround is to listen for the animation events in the view to which you were applying the animation to For example if initially you were … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)