RenderScriptにAPI level17から提供されたScriptIntrinsicBlurを下位バージョンでも利用しようとしたときのメモ。 RenderScriptって RenderScriptについては、ぼくはこのブログ記事でなんとなーく雰囲気をつかんだ程度です。 GPUで処理してくれる描画エンジン。 [翻訳]RenderScriptについてAndroidDeveloperBlogを読んでみた。 | superdry memorandum :-D 画像処理に使えるAPIもあって、今回はScriptIntrinsicBlurを使いたかったのです。 RenderScript自体はAPI level11から使えるけど、Android Developersによると We strongly recommend using the Support Library APIs for acce
Inspiring growth through innovative app experiences and digital products We deliver high-profile, can’t fail applications for a variety of clients and industries. With a focus on mobile applications for handsets and tablets, native development is our specialty while we also have in-depth experience with newer, cross-platform technologies such as React Native and Flutter. We help our clients engage
開発してるとActivityにBitmapを持たせたいことってよくある でもメンバで持ってると自前で解放しなくてはならない。 Bitmapのメモリ管理はネイティブ側で管理されてるので明示的に開放する必要がある。 マジで?って思ったので実験してみた 実験内容 以下のパターンでBitmapActivityがどのように変化するかを確認 実験1 ImageViewを持たないActivity 実験2 レイアウトでImageViewを持ったActivity 実験3 レイアウトでImageViewを持ち、メンバ変数でもImageViewをもつActivity 実験4 ImageViewを持ち、メンバ変数でBitmapをもつActivity 実験5 Bitmap#recycleの正しい使い方 使うアプリ こんな感じのアプリ 実験2〜4 MainActivity>BitmapActivity>(戻るキーで)
背景画像を repeat させたい場合、ImageView とかの属性では実現できません。 BitmapDrawable で repeat した画像を作って、背景に指定するば OK です。 BitmapDrawable はコードからも生成できますが、xml で作ったほうが楽です。 Bitmap Resource の XML Bitmap のところを参照してね。 XML ファイルは res/drawable/filename.xml XML ファイルの中身の SYNTAX <bitmap xmlns:android="http://schemas.android.com/apk/res/android" android:src="@[package:]drawable/drawable_resource" android:antialias=["true" | "false"] androi
それではリソースとして配置した画像ファイルを利用して「Bitmap」クラスのオブジェクトを作成する方法を確認します。「BitmapFactory」クラスで用意されているstaticメソッドの「decodeResource」メソッドを使います。 decodeResource public static Bitmap decodeResource(Resources res, int id) Decode an image referenced by a resource ID. Parameters: res Resources id resource ID Returns: The resulting decoded bitmap, or null. 1番目の引数には引数には「Resources」クラスのオブジェクトを指定します。このオブジェクトはアプリケーションのリソースを管理しているも
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く