android - saving bitmap after translation saves bitmap with black area -
i have used custom view contains canvas draw bitmap, overlay, shapes etc. custom view added relative layout in activity. problem while translate image on canvas edit bottom portion of image, edits after editing when save bitmap saved bitmap contains part of original bitmap shown @ time of save....remaining part of bitmap not shown on screen bcoz of translation not saved black part bitmap.... solution problem..? thanks.
private void settingbitmaptodraw() { // todo auto-generated method stub resultbitmap=bitmap.createscaledbitmap(resultbitmap, width, height, true); matrix matrix=new matrix(); matrix.setrotate(to_degree); tempbitmap=bitmap.createbitmap (resultbitmap, 0, 0, width, height, matrix, true); if(bitmap!=null) { bitmap.recycle(); bitmap=null; } bitmap=bitmap.createbitmap(width, height, tempbitmap.getconfig()); canvas=new canvas(bitmap); invalidate(); }
Comments
Post a Comment