I'm developping a mobile application using C++ Builder. I wanted to change the Bitmap of a FireMonkey TImage using the function LoadFromFile():
MyImage->Bitmap->LoadFromFile("My Image location");
I added the pictures to the project but I can't find the location of my Bitmap files. Does it exist a function or a parameter to find the location of these files?
I found why my Picture loading failed. I tried to use a .bmp file which is only supported on Windows and OSX. I worked with the instruction given by Kerem D here. I converted my picture to a PNG format and now it worked. Thank you all for your answers!
Related
I'm trying to create an Android application using QT where I load image from the device and display it on the application.
I can create an application and load it to an Android device, and I can also successfully import OpenCV.
I'm having problem loading image file using:
QFile::exists("PATH_TO_FILE");
QImage image("PATH_TO_FILE");
QFile::exists says that the file I'm trying to load exists. However, when I try to load the image, my image is null.
I've tried loading an image from both internal and external memory with the following permission added to my AndroidManifest.xml: android.permission.READ_EXTERNAL_STORAGE.
I want to load image from the device camera and display it on the widget. I can compile the application with OpenCV. However, when I tried to get image by:
VideoCapture vid;
vid.open(0);
Mat img;
vid >> img;
I get image of size 0. I did added permission android.permission.CAMERA to my AndroidManifest.xml.
Can someone please help me out? I'm not sure what I'm missing and why I'm getting null images from both files and cameras.
Any help would be appreciated
Sincerely,
Steve
Trying to learn about how to verify an image which is stored inside android app ( somewhere in Asset folder ) to a card which already has some logo (check if both the logo are identical) using camera .
Was reading about Open CV but it is all in C++ . Need Java code.
Any rough idea or document or link or tutorial anything will be appreciated.
Why don't you make use of JavaCV, it's a port of OpenCV.
https://github.com/bytedeco/javacv
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 have an address to my mobile image like
/sdcard/DCIM/Camera/1.jpg
or
/storage/emulated/0/DCIM/Camera/1.jpg
I use QFile and QImage for read that
when read image with qfile, it can't open that but exist function return true
qimage also can't load image
I also use file:// before upper addresses but not worked.
I use qt 5.8 and api 23(android 6) and i make android manifest file and take permission for read and write to storage.
Your problem may be related to using too large resolution images. If you set the sourceSize property, it scales down youre image to the desired resolution.
I'm trying to read a dicom file using the instructions given in "Adding Imebra to your Intellij Idea" and am facing issues with the same.
The exact code snippet where am facing the issue is this:
Stream stream = new Stream();
stream.openFileRead("/sdcard/Download/87FDH4G2.dcm");
The error I get is that the stream cannot be opened. I believe the error is due to the non-availability of 87FDH4G2.dcm file on my machine.
My question is where should the location of 87FDH4G2.dcm file be on my machine?
I am confused with this part: /sdcard/Download/87FDH4G2.dcm
The reason why you have such a problem is simple. You do not have "87FDH4G2.dcm" file on your Android device or emulator (Android Virtual Device). Using Android Device Monitor you can browse files and check if you saved a DICOM image in correct directory.