Commit a603373e by german

Picto updated

parent 0d8ed678
...@@ -54,9 +54,7 @@ public class Picto extends Img { ...@@ -54,9 +54,7 @@ public class Picto extends Img {
public static String PCB_STATUS_MODIFICATION="pcb_status_modification"; public static String PCB_STATUS_MODIFICATION="pcb_status_modification";
public static String EXPRESSION = "expression"; public static String EXPRESSION = "expression";
public static String MIRROR = "mirror"; public static String MIRROR = "mirror";
public static String LEGEND = "legend";
/**Modificacion German*/
public static String LEGEND="legend";
} }
...@@ -425,14 +423,14 @@ public class Picto extends Img { ...@@ -425,14 +423,14 @@ public class Picto extends Img {
Log.i("TAG_NUEVO","ancho: "+width); Log.i("TAG_NUEVO","ancho: "+width);
Log.i("TAG_NUEVO","alto: "+height); Log.i("TAG_NUEVO","alto: "+height);
Log.i("TAG_NUEVO","densidad: "+dens); Log.i("TAG_NUEVO","densidad: "+dens);
//if(!get_legend().equals(JSON_ATTTR_LEGEND_VALUES.NONE)){ //Si tiene leyenda if(!get_legend().equals(JSON_ATTTR_LEGEND_VALUES.NONE)){
String texto = this.translation.toUpperCase(); String texto = this.translation.toUpperCase();
String[] words = texto.split(" "); String[] words = texto.split(" ");
StringBuffer txt = new StringBuffer(); StringBuffer txt = new StringBuffer();
if (words.length == 1) {//Si solo hay una palabra if (words.length == 1) {
if (words[0].length() > 10) { //Si es mayor de 10 caracteres if (words[0].length() > 10) {
texto = ""; texto = "";
int mitad = (words[0].length() / 2) - 1; int mitad = (words[0].length() / 2) - 1;
...@@ -466,7 +464,8 @@ public class Picto extends Img { ...@@ -466,7 +464,8 @@ public class Picto extends Img {
} }
} }
//if(get_legend().equals(JSON_ATTTR_LEGEND_VALUES.NORMAL)) { if(get_legend().equals(JSON_ATTTR_LEGEND_VALUES.NORMAL)) { //Normal legend
android.graphics.Bitmap.Config bitmapConfig = bitmap.getConfig(); android.graphics.Bitmap.Config bitmapConfig = bitmap.getConfig();
if (bitmapConfig == null) { if (bitmapConfig == null) {
bitmapConfig = android.graphics.Bitmap.Config.ARGB_8888; bitmapConfig = android.graphics.Bitmap.Config.ARGB_8888;
...@@ -476,7 +475,6 @@ public class Picto extends Img { ...@@ -476,7 +475,6 @@ public class Picto extends Img {
Canvas canvas = new Canvas(bitmap); Canvas canvas = new Canvas(bitmap);
if(cont == 0) { if(cont == 0) {
//Copiar el bitmap a uno nuevo y reescalar
Bitmap bm = Bitmap.createScaledBitmap(bitmap, width / 2, height / 2, false); Bitmap bm = Bitmap.createScaledBitmap(bitmap, width / 2, height / 2, false);
canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR); //Poner en blanco el bitmap original para dibujar encima canvas.drawColor(Color.TRANSPARENT, PorterDuff.Mode.CLEAR); //Poner en blanco el bitmap original para dibujar encima
canvas.drawBitmap(bm, 25, 0, paint); canvas.drawBitmap(bm, 25, 0, paint);
...@@ -498,10 +496,9 @@ public class Picto extends Img { ...@@ -498,10 +496,9 @@ public class Picto extends Img {
} }
//}else{ }else{
//Solo texto //Only legend
android.graphics.Bitmap.Config bitmapConfig = bitmap.getConfig();
/*android.graphics.Bitmap.Config bitmapConfig = bitmap.getConfig();
if (bitmapConfig == null) { if (bitmapConfig == null) {
bitmapConfig = android.graphics.Bitmap.Config.ARGB_8888; bitmapConfig = android.graphics.Bitmap.Config.ARGB_8888;
} }
...@@ -529,7 +526,7 @@ public class Picto extends Img { ...@@ -529,7 +526,7 @@ public class Picto extends Img {
canvas.drawBitmap(textView.getDrawingCache(), 0, 25, null); canvas.drawBitmap(textView.getDrawingCache(), 0, 25, null);
} }
}*/ }
return bitmap; return bitmap;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment