android+Bitmap Class

來源:互聯網
上載者:User

標籤:

 

public void getPixels (int[] pixels, int offset, int stride, int x, int y, int width, int height)

把位元影像的資料拷貝到pixels[]中。每一個都由一個表示顏色值的int值來表示。幅度參數表明調用者允許的像素數組行間距。對通常的填充結果,只要傳遞寬度值給幅度參數。
參數
pixels      接收位元影像顏色值的數組
offset      寫入到pixels[]中的第一個像素索引值
stride      pixels[]中的行間距個數值(必須大於等於位元影像寬度)。可以為負數
x           從位元影像中讀取的第一個像素的x座標值。
y           從位元影像中讀取的第一個像素的y座標值
width      從每一行中讀取的像素寬度
height    讀取的行數              
異常
IilegalArgumentExcepiton       如果x,y,width,height越界或stride的絕對值小於位元影像寬度時將被拋出。
ArrayIndexOutOfBoundsException          如果像素數組太小而無法接收指定書目的像素值時將被拋出。

 

related links:

http://ranlic.iteye.com/blog/1313735  //introduce getPixels function

android+Bitmap Class

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.