パスから画像を表示しようとしています。私はdrawableに画像を移動する場合、私は画像を表示することができますが、私は彼の画像パスから画像を表示したい。 GetImageBitmapFromUrl( "image path")でimageBitMapを使用しようとしましたが、空白の画面しか表示されません。私が試した出向方法があるAndroid.Net.UriのURL = Android.Net.Uri.Parse(「画像パス」)私は、ビューのようにパスを呼び出してみましたが、違いを確認していないようファイルパスから画像をxamarinに表示
namespace SetPictureUrl
[Activity(Label = "SetPictureUrl", MainLauncher = true, Icon = "@drawable/icon")]
public class MainActivity : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.Main);`{
ImageView imagen = FindViewById<ImageView>(Resource.Id.demoImageView);
//------------------ i tried but did not work. the screen is blank
// var imageBitmap = GetImageBitmapFromUrl("my image path");
// imagen.SetImageBitmap(imageBitmap);
//---------------- i tried but did not work. the screen is blank
Android.Net.Uri url = Android.Net.Uri.Parse("./HTC Desire 620/Internal storage/storage/emulated/0/test/fox.jpeg");
imagen.SetImageURI(url);
//----- this work but is not the way i wish to do it. my main program work with file paths
// imagen.SetImageResource(Resource.Drawable.fox);
}
例:
(./HTC欲望620 /内部記憶装置/記憶/エミュレート/ 0 /試験/ fox.jpeg)
、(HTC欲望620 /内部記憶装置/記憶/エミュレート/ 0 /試験/ fox.jpeg)
と(¬/ HTC Desire 620 /内部ストレージ/ストレージ/エミュレート/ 0 /テスト/ fox.jpeg)
喜びはありません。私はどんな助けも大好きです。なぜこれが私にそんなに大きな問題を与えるのかわからない/
ここからパスを取得しますか? '/ HTC Desire 620/Internal Storage'は携帯電話には存在しません... – Cheesebaron
私は写真を撮ってからのパスを表示し、電話で私の電話のメモリを見て確認します。彼らは一致する – oisin1min
電話のメモリをどのように確認するか分からないが、この場合の正しいパスは '/ storage/emulated/0/test/fox.jpeg' – Cheesebaron