screenshot in Android - 4
Everyone knows that the android device supports free rotation, however, my application just copes the framebuffer and builds jpeg files with solid resolution. The problem is how to transfer the framebuffer matrix into the correct matrix, during the rotation.
Let me give a sketch map for explanation as bellows.
(Aij) (Bmn)
0 1 2 3 4 a 5 0
5 6 7 8 9 ====> b 6 1
a b c d e c 7 2
d 8 3
e 9 4
So we should realign the jpeg matrix Bmn from the original Aij and the key problem is getting the relationship between mn and ij. (which (m, n), (i, j) is the coordinate)
if rotate the screen 90 degree in the time order, then the relationship will be
{i = height - 1 - n; j = m}.
if rotate the screen 180 degree in the time order, then it will be
{i = height - 1 - m; j = width - 1 - n}.
if rotate the screen 270 degree in the time order, then it will be
{i = n; j = width - 1 - m}.
According these rules, you can get the correct jpeg files even rotating devices.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/25432352/viewspace-732929/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- screenshot in Android - 3Android
- Collabration Web Application Screenshot(English Language) Free download now!WebAPP
- Android_AutoRoom 4AndroidOOM
- Android小技巧(4)Android
- Android View體系(4)AndroidView
- Android模糊影象教程(4)Android
- 4、Android UI測試AndroidUI
- 如何使用 gnome-screenshot 截圖命令來擷取螢幕、視窗或指定區
- Android學習筆記(4)Android筆記
- JAVA4ANDROID筆記JavaAndroid筆記
- Android文字時鐘 — Part4Android
- Android Notification 用法的4種形式Android
- Android開發貼士集合(4)Android
- android原始碼檢視 android-support-v4.jarAndroid原始碼JAR
- Xamarin.Android提示找不到mono.Android.Support.v4AndroidMono
- Android 使用Fiddler4抓包Android
- Android基礎課堂-Lesson.4Android
- Android Things 專題 4 SDK 框架Android框架
- 好書妙評之《精通Android 4》Android
- Android4 Source Analysis - Root-ExternalAndroid
- Android開源框架如何說-Gilde4Android框架
- Android開發貼士集合(Part 1~4)Android
- Android效能優化典範 – 第4季Android優化
- Android開發之道(4)程式框架基礎Android框架
- Android UI 設計(4):EditText 控制元件AndroidUI控制元件
- Android四大元件之Activity----重新認識Android(4)Android元件
- android.support.v4.app.Fragment vs android.app.Fragment 的區別AndroidAPPFragment
- Android 網路程式設計系列(4)使用 HttpUrlConnectionAndroid程式設計HTTP
- Android知識點複習4(ContentProvider)AndroidIDE
- CrashMonkey4Android 的安裝及使用Android
- 最新Android 4.x 搭建開發環境Android開發環境
- 提高 Android 程式碼質量的4個工具Android
- 專家審讀第7期——《精通Android 4》Android
- 高效Android開發者必須知道的4個工具Android
- Android 高階面試-4:虛擬機器相關Android面試虛擬機
- 程式包android.support.v4.app…不存在AndroidAPP
- MVP那些事兒 (4) 在Android中使用MVC(下)MVPAndroidMVC
- #io17# 釋出Android Things Developer Preview 4AndroidDeveloperView