簡體   English   中英

以原始分辨率的Android顯示圖像

[英]Display Image in Original Resolution Android

我有一個尺寸為129px×1579px的圖像,我希望它不縮放就顯示! (原樣)。

我嘗試使用ImageView顯示,將ImageView放置在drawable文件夾, drawable-nodpi文件夾中,但始終會縮放!

我什至嘗試使用WebView顯示它,但是渲染的HTML頁面根據不同的屏幕尺寸進行縮放!

似乎沒有任何工作。

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#444444"
android:orientation="vertical" >

<ScrollView
   android:layout_width="wrap_content"
   android:layout_height="wrap_content" >

<ImageView
    android:id="@+id/imageView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/ruler" />
 </ScrollView>
 </LinearLayout>

問題:“是否可以通過這些方式顯示自己的圖像?

更新:

圖片是標尺,因此必須正確渲染(原樣)

統治者

謝謝

將圖像放置在drawable或drawable-nodpi中將阻止根據設備dpi縮放。

將ImageView縮放比例設置為CENTER-這將防止ImageView通過http://developer.android.com/reference/android/widget/ImageView.ScaleType.html縮放比例將其添加到您的ImageView中:

android:scaleType="center"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM