Rotate the picture and change the display text font and so on textView

2010-03-29  来源:本站原创  分类:Mobile  人气:365 

1.private void animateRotation (int degrees, float durationOfAnimation) (
long startTime = SystemClock.elapsedRealtime ();
long currentTime;
float elapsedRatio = 0;
Bitmap bufferBitmap = carBitmap;

Matrix matrix = new Matrix ();

while (elapsedRatio <1) (
matrix.setRotate (elapsedRatio * degrees);
carBitmap = Bitmap.createBitmap (bufferBitmap, 0, 0, width, height, matrix, true);
/ / draw your canvas here using whatever method you've defined
currentTime = SystemClock.elapsedRealtime ();
elapsedRatio = (currentTime - startTime) / durationOfAnimation;
)

/ / As elapsed ratio will never exactly equal 1, you have to manually draw the last frame
matrix = new Matrix ();
matrix.setRotate (degrees);
carBitmap = Bitmap.createBitmap (bufferBitmap, 0, 0, width, height, matrix, true);
/ / Draw the canvas again here as before
/ / And you can now set whatever other notification or action you wanted to do at the end of your animation

)
This method extracts image 300 * 300 or less

2.

tv.setText("Your Number Is..."+ random, TextView.BufferType.SPANNABLE );
Spannable myText = (Spannable) tv.getText();
myText.setSpan(new StyleSpan(android.graphics.Typeface.BOLD_ITALIC),0,myText.length(),0);

相关文章
  • Rotate the picture and change the display text font and so on textView 2010-03-29

    1.private void animateRotation (int degrees, float durationOfAnimation) ( long startTime = SystemClock.elapsedRealtime (); long currentTime; float elapsedRatio = 0; Bitmap bufferBitmap = carBitmap; Matrix matrix = new Matrix (); while (elapsedRatio <

  • Rotate the image and change the display of text fonts textView 2010-03-14

    1.private void animateRotation (int degrees, float durationOfAnimation) ( long startTime = SystemClock.elapsedRealtime (); long currentTime; float elapsedRatio = 0; Bitmap bufferBitmap = carBitmap; Matrix matrix = new Matrix (); while (elapsedRatio <

  • Change the display text of a label with the use of TextView label 2010-12-29

    In Android First Course (e) We wrote a HelloAndroid, have been a half lines of code that I'm sorry did not write myself, so this section, we will HelloAndroid basis for TextView text labels with the first contact. In this case, will create a TextView

  • listView a change of display text 2010-09-03

    ListView list = (ListView) findViewById (R.id.list); adapter = new MyAdapter (this, R.layout.main, R.id.row_text, new String [] ("Uno", "Dos", "Tres")); list.setAdapter (adapter); / / Custom Adapter class private class MyAdap

  • J2ME in the lower branch of the user interface to display text 2010-10-07

    Low-level user interface in J2ME development, Canvas often encounter the need to display a lot of text, such as on interface, game shows, game announcements and other information. If the design, content and length of the text are fixed, is not conduc

  • Custom display text and pictures Toast 2010-11-17

    Toast used to indicate the current application status information, such as network connection status, etc. usually display a text, you can also customize your own Toast. The following are examples: public class MyActivity extends Activity { /** Calle

  • [Transfer] BMPText and BMPSlicer - will cut into the block bitmap to display text 2011-01-07

    Because the expression vector is limited, so we often need to use external images to display text and other information, is the case most display numbers and letters. However, if each number or letter of a picture made in the program is running, it i

  • Offic: display text rotated 90 degrees 2011-04-15

    In Offic, how to rotate 90 degrees vertically, the font display? Solution Method 1: Use HTML mode to display text. First, the data type of the cell type into HTML, and then fill in the cell: <div"FILTER: progid:DXImageTransform.Microsoft.BasicImag

  • I used Linux command of the echo - display text. Print Information 2010-10-15

    I used Linux command of the echo - display text, print information This link: http://codingstandards.iteye.com/blog/786101 (reproduced please indicate the source) Use Description echo command to print information, is one of the most commonly used com

  • RAQ Report: display text rotated 90 degrees 2011-04-15

    In RAQ Report, how to rotate 90 degrees vertically and font display? Solution Method 1: Use HTML mode to display text. First, the cell type into HTML-based data, and then fill in the cell: <div"FILTER: progid:DXImageTransform.Microsoft.BasicImage(

  • Rotate the picture in several ways 2010-04-15

    1, each under the rotation matrix from the rotation after the in situ map to create a new bitmap. But the drawback is to ship the new bitmap. / / Createa matrix for the manipulation Matrix matrix = new Matrix (); / / Rotate the Bitmap matrix.postRota

  • tabHost dynamically change the title text, image dynamic changes 2010-06-29

    / / Monitor tab state change, and modify the response to pictures tabHost.setOnTabChangedListener (new OnTabChangeListener () ( public void onTabChanged (String tabId) ( if (TAB_MAP.equals (tabId)) ( ImageView iv = (ImageView) tabHost.getTabWidget ()

  • flex reads the text and display text messages 2010-12-21

    flex reads the text and display text messages package components { import flash.utils.ByteArray; [Embed(source="GridDemo.mxml", mimeType="application/octet-stream")] public class foobar extends ByteArray { } } GridDemo.mxml order to re

  • Picture identification skills to use the font name 2010-07-12

    Zai work, I often encounter some of the pictures sent by customers of Bao Han a number of English manuscript art of fonts, and I am the Dian Nao Du Mei You usually installed in the fonts Zhexie Guo, Shen Zhi Lian the names of these fonts do not know.

  • [Reserved] dynamic "change" flash display object registration point 2011-01-01

    http://www.eb163.com/club/thread-16407-1-4.html Of: L4cd How often have friends ask .. dynamic modification of a display object registration point .. The general's friends need to modify the registration point, the needs are basically rotating .. To

  • secureCRT change the display width 2011-06-15

    After each landing with secureCRT sqlplus query data is off-line display, even if the parameters set lines 1024 is useless, very unhappy, and today finally get. SecureCRT v5.5.1 (build 407) 1, the first global settings: Options - Global Options - Ter

  • On the display text is too long dealing with css 2010-03-29

    On the page we often encounter the content displayed is too long, we need only briefly display a long text, if not addressed will frequently label to distraction, is not like the page layout looks like. We may have the experience to deal with this is

  • android icon size issues and the status bar set to display text 2010-04-17

    http://developer.android.com/guide/practices/ui_guidelines/icon_design.html # statusbarstructure I did not find the text of the api to support anyone who ah tell me how to find the status bar displays the text, but can be a plus to be a The picture i

  • Compatible with IE, Firefox custom tips, floating display text 2010-04-21

    Most of the code from the network, you can define your own page name variable qTipTag example to traverse all of the TD to write qTipTag = 'td';, I also added a qTipClassName it points to the need to do tips deal, only the definition of the specified

  • android AlertDialog change the display position 2010-08-04

    AlertDialog dlg = new AlertDialog.Builder (this). Create (); //------------------------------------------------ ------------------- Window w = dlg.getWindow (); WindowManager.LayoutParams lp = w.getAttributes (); lp.x = 10; lp.y = 150; //------------