Ask you great God, I am using a homemade map images and pictures via GPS and then change the relative position of the mark,
Now nearly positioning function, the problem we encounter is: I use a imageview as a background map, you can zoom, but the size of my upper marked coordinates again, I will follow changes in the size of the zoom, I ask, I used What can make the size of the upper coordinate unchanged, and can have a click event!
Reply:
Reduce the number of times the background, marked on the enlarged many times. This will offset the background scaling, maintaining a fixed size
Reply:
1st Floor positive solution that helps you find relevant information
Reply:
I understand what you mean, if I use canvas redraw this map, then click event marked, there is no way to add?
Is there a better way?
Reply:
Reply:
Similarly encountered such a problem-solving
Reply:
Does your program have enough memory to load this picture of the situation does not appear ah, I always have this problem, how do you solve?
Reply:
Give you a calculation of
bitmap algorithm/ **
* Bitmap algorithm
* /
public static int computeSampleSize (BitmapFactory.Options options,
int minSideLength, int maxNumOfPixels) {
int initialSize = computeInitialSampleSize (options, minSideLength,
maxNumOfPixels);
int roundedSize;
if (initialSize <= 8) {
roundedSize = 1;
while (roundedSize
}
} Else {
roundedSize = (initialSize + 7) / 8 * 8;
}
return roundedSize;
}
private static int computeInitialSampleSize (BitmapFactory.Options options,
int minSideLength, int maxNumOfPixels) {
double w = options.outWidth;
double h = options.outHeight;
int lowerBound = (maxNumOfPixels == -1) 1:?
(Int) Math.ceil (Math.sqrt (w * h / maxNumOfPixels));
int upperBound = (minSideLength == -1) 128:?
(Int) Math.min (Math.floor (w / minSideLength),
Math.floor (h / minSideLength));
if (upperBound
return lowerBound;
}
if ((maxNumOfPixels == -1) &&
(MinSideLength == -1)) {
return 1;
} Else if (minSideLength == -1) {
return lowerBound;
} Else {
return upperBound;
}
}
Then so used
InputStream is = this.getResources () openRawResource (R.drawable.map2);.
BitmapFactory.Options option = new BitmapFactory.Options ();
option.inSampleSize = computeSampleSize (option, -1, 1909 * 2089);
option.inJustDecodeBounds = false;
bitmap = BitmapFactory.decodeStream (is, null, option);
Avoid memory overflow
Reply:
Ask the landlord how homemade map. . Now I also need to be made a map. Google is the imitation of an entire planet that effect. I wonder if the landlord Can teach me ~
Reply:
Hello, I am a android developer, would like to ask your self the map, and I hope to get your reply, my QQ: 1246071330
Reply:
Want to learn to share custom maps landlord seeking Demo
Reply:
Very much hope that the landlord can share custom maps, and location of DEMO, be grateful! ! !
No comments:
Post a Comment