Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

graphics - How to create crisp background image for 1x1 Android widget? -


i'm creating 1x1 widget, , no matter try, can't background image looking nice , crisp. i've read resource can find, yet still can't win.

i'm designing htc desire/nexus 1, , love tell me when creating background in photoshop, dpi/height/width use (currently using 72/100/80). i'll worry other devices resolutions once can looking nice on test device first.

also, if there's special need putting in @layout/main.xml , widget_provider.xml files. can't find examples 1x1 gadgets, have following:

main.xml

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/widget" android:layout_width="fill_parent" android:orientation="vertical" android:background="@drawable/background"  android:layout_gravity="center"  android:layout_height="wrap_content"> 

widget_provider.xml

<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android" android:minwidth="72dip" android:minheight="72dip" android:updateperiodmillis="6000000" android:initiallayout="@layout/main" /> 

any appreciated.

you may want have @ google's supporting multiple screen sizes document. happening here screens on android devices have different pixel densities. these categorized low, medium, high (ldpi, mdpi, hdpi). if asset isn't large enough larger density screen, blown proper size - happening you.

the nexus 1 has dpi somewhere around 250 puts hdpi class. using google formula of (number of cells * 74) - 2 calculate dp 1x1 widget make widget dimensions 72x72 dp.

the conversion dp pixels is:

pixels = dp * (density / 160) 

so 72x72 dp image, corresponding image sizes based on density be:

ldpi  (120 dpi) = 72 * (120 / 160) == 54 x 54 pixels mdpi  (160 dpi) = 72 * (160 / 160) == 72 x 72 pixels hdpi  (240 dpi) = 72 * (240 / 160) == 108 x 108 pixels xhdpi (320 dpi) = 72 * (320 / 160) == 144 x 144 pixels 

use these formulas create assets , should crisp images.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -