Re: [問題] Imageview轉貼的問題

看板AndroidDev作者 (討厭KFC)時間12年前 (2013/03/04 02:59), 編輯推噓2(202)
留言4則, 2人參與, 最新討論串2/2 (看更多)
我成功可以換頁了 但是我現在想把 Intent 加上 Bundle 把 大圖的對應的 view 貼到 另一個activity 得canvas上(透過bitmap) 我該用什麼putExtra才對,我想問得是我該傳 對應的 VIEW(imgShow) 還是 我在一開始設定的圖片的int[] (imageIds) 但是後者是陣列型式,我該如何操作,抱歉問題有點多 我用前者加上 getParcelable 會發生錯誤 讓我有點苦惱~ 麻煩了~~ ※ 引述《treeyoyo (討厭KFC)》之銘言: : 我現在做了一個gallery在上面的配置 : 以下是畫面 : 圖一 圖二 圖三 (這塊往左往右滑動) : --------- : 這塊秀上面圖一~圖三的大圖 : --------- : 我現在想將下面大圖做成按下去 : 轉到另一格畫面(我另一個畫面想 : 用canvas弄成一個像小畫家畫畫板這樣) : 我該用什麼方式轉過去 : 下面顯示是imageView 可以做成button嗎? : 利用Intent的方式可行嗎? 抱歉問題有點多~每天都被老師追殺很無助 : 以下是程式碼 : layout 配置 : <?xml version="1.0" encoding="UTF-8"?> : <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" : android:orientation="vertical" : android:layout_width="fill_parent" : android:layout_height="fill_parent" : > : <Gallery : android:id="@+id/gallery" : android:layout_width="fill_parent" : android:layout_height="100dp" : android:spacing="10dp" : /> : <ImageView : android:id="@+id/imageview" : android:layout_width="fill_parent" : android:layout_height="fill_parent" : /> : </LinearLayout> : ---------------------------------------------------------------------------- : 控制的程式碼 : http://pastebin.com/vxDQsYTk : 抱歉版面有點亂~請求大大幫忙了 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.124.77.3

03/04 12:07, , 1F
似乎不能傳遞 ID (不確定),另外必須是 parcelable 的
03/04 12:07, 1F

03/04 12:08, , 2F
的型態才能被 parcel
03/04 12:08, 2F
那我想做這個貼圖的功能還能用什麼方式傳遞我的圖檔呢?:( ※ 編輯: treeyoyo 來自: 140.124.77.3 (03/04 12:21)

03/04 12:53, , 3F
把view的內容抓下來轉成byteArray傳過去,那邊再把編輯過
03/04 12:53, 3F

03/04 12:55, , 4F
的內容轉成byteArray用setResult回來
03/04 12:55, 4F
文章代碼(AID): #1HD0tr3i (AndroidDev)
討論串 (同標題文章)
文章代碼(AID): #1HD0tr3i (AndroidDev)