Gautam17 / android-multitouch-controller

Automatically exported from code.google.com/p/android-multitouch-controller
0 stars 0 forks source link

how to implement if the images are not in resources?(load image from server) #14

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,
This code works fine, but i have load image from server instead of resource.
Is it possible? if yes plz provide some hint or guideline.

Thanks.

Original issue reported on code.google.com by hrdabhi3...@gmail.com on 22 Apr 2013 at 5:10

GoogleCodeExporter commented 8 years ago
Download it via HttpClient and HttpResponse.
Create a Bitmap out of the Bytestream
Byte[] bytes = EntityUtils.toByteArray(entity);
Bitmap bitmap = BitmapFactory.decodeByteArray(bytes, 0,
                    bytes.length);
and draw it in your canvas via canvas.drawBitmap

If you use Drawable download it save it to an Inputstream and open it via 
Drawable.createfromStream(my stream)

Original comment by sebastia...@gmail.com on 30 Aug 2013 at 7:12

GoogleCodeExporter commented 8 years ago
Hi,
I am also having the same problem.
I am trying to use this library on images that are randomly picked from phone 
gallery.
I am having the path of the images , but not getting that how to use the 
library on those images.
Please provide any solution. I have tried a lot and stacked here for 3 days.

Original comment by aakanksh...@gmail.com on 27 May 2014 at 7:09

GoogleCodeExporter commented 8 years ago
Hi, the multitouch demo app was never intended to be a full photo viewer -- for 
starters, it is not OpenGL-accelerated, so it is slow and power-hungry. Also, 
images are loaded from resources just because it was the simplest possible way 
to load them. There are many Android tutorials on how to load images from other 
locations, for example by means of an Intent, or from a file on the SD card. A 
Google search for "Android load image" returns the following as the top hit, 
but there are many other relevant links too:

http://developer.android.com/training/displaying-bitmaps/load-bitmap.html

I'm closing this issue since it is not a bug with the actual multitouch 
library, but Stack Overflow is a great place to ask general Android programming 
questions if your code still isn't working after following the information at 
the above link. I hope this helps!

Original comment by luke.hutch on 28 May 2014 at 10:51