I am trying to follow the link below for the code for a Image viewing app in android.
android image "viewer" app
But I am getting an error with the r.raw.image1. (also on raw.image2 and image3). I have saved the images in the asset folder. Error says raw cannot be resolved or is not a field. I have checked various documentations for this but am unable to understand what i am doing wrong. The code is exactly the same as in the above link.
Try to save your image into res/raw folder.
Related
I am trying to use custom marker using marker image that is provided as .bmp file. I am building cross platform application using Flutter and this is the native code for Android. The image is from the assets in pubspec.yaml in flutter project.
marker = map
.addMarker(MarkerOptions()
.position(annotation.coordinate)
.title(annotation.title)
.icon(BitmapDescriptorFactory.fromAsset("lib/green_circle.bmp")))
I got this error message for the code above:
com.google.maps.api.android.lib6.common.apiexception.b: Failed to
decode image. The provided image must be a Bitmap.
I checked the image, and it's bmp
There seems to be a problem with the way it handles the images. It does accept png, jpg and bmp, as I have tested with all of those, but I also had that same issue with some files of these formats (png and bmp).
What I did was open some of the files on another image editor, overwrite the files, and it worked. Weirdly, the files were normal png icons from Adobe Photoshop, and they didn't work.
If you have any issues or doubts, maybe try debugging with files from other sources, or editing it and saving it again.
I received the same error message for a different reason. My file was fine, but I provided an incorrect path to the file.
Make sure you get the directory and filename correct!
I'm working on an app, using ionic2.
I'm storing a set of images that I downloaded from the server in the dataDirectory to save mobile traffic when the app is used without wi-fi.
Now, I would like to display them inside my template.
Is there a recommended way how the image should best be inserted?
I tried giving the ion-img or img-tag
the complete path (file.dataDirectory + “myImg.jpg” -> "file:///data/user/0/io.ionic.starter/files/myImg.jpg”
(stored in my imgPath variable, the path is written after the platform.ready event), but only a broken image symbol is shown. When accessing images from my assets folder I do not encounter any problems, but how can I access the dataDirectory’s images?
<img width=“200” height=“200” [src]=“imgPath” *ngIf=“imgPath”>
Or do I have to read each image from the dataDirectory and store them in a local variable as a base64 string?
There are many reason for showing broken image in IONIC.
If you are using live reload then sometime images are shown as broken image. You can run directly to see if it resolves your issue.
If you want to use base64 image, either you can save it SQLite or in local variable which may resolve your issue.
I am new to Android and now trying to retrieve contact photo (thumb nail) from a content provider and set it onto my app. But for that as i am running on an AVD, i pushed some .png photos onto my 2.2 version. Now i tried to create a contact with the photo, but the Gallery is showing "No Media Found", hence i am stuck here.
Please help me in getting the photo visible in gallery.
Note : I am aware of the following facts :
I have restarted my AVD to force the Media Scanner to do its initial mockups.
Also i have seen the .png file through the File Explorer View of Eclipse Framework.
But strangely, I am not able to pull the file off the phone.
I have taken help of the link get the path of a Gallery Folder in Android for understanding the general view on Media Scanner.
I believe this is because the application doesn't know if there are images inside /data.
Try to put your images in:
/mnt/sdcard/Pictures
Does anyone know an Application which opens a dcm file when it is clicked on in say a file manager? I need to be able to load a dcm from a http url into an app that displays a dicom image.
I found one app with name Droid Dicom Viewer in some posts about .DCM file.
I found this link to get details about Droid Dicom Viewer.
ADIView - Android DICOM Image Viewer
I downloaded Android 2.2 (proyo) source code and compiled it.
I looked at the app folder and I found Gallery and Gallery3D.
I created an Android project from existing source code(Gallery) on Eclipse. It appears on Eclipse as GalleryPicker with errors. If I created an Android project from Gallerry3D then it doesn't complain.
My question is what is the difference between Gallery and GalleryPicker (Gallery3d and Gallery in Android source code).
Also, how do I get rid of errors on the GalleryPicker?
Thanks in advance..
If I follow your question correctly Gallery3d is an application (loaded from your app drawer) for viewing images and Gallery (android.widgets.Gallery, I believe) is a widget which displays a filmstrip of images above a blow up of the selected image.