2012-06-16 35 views
0

朋友你好我需要捕获图像和需求后,发送良好品质的图像到服务器我写下面的代码为如何保存拍摄图像中的本地目录,并将其发送给服务器

    image = (Bitmap) intent.getExtras().get("data"); 
       Display display = getWindowManager().getDefaultDisplay(); 
       width = display.getWidth(); 
       height = display.getHeight(); 

       Matrix mat = new Matrix();//removing rotations 

       String version= Build.VERSION.SDK; 
       Log.e("Version Number ",version); 
       if(Integer.parseInt(Build.VERSION.SDK) > 8) 
       { 
        mat.preRotate(0);//removing rotations of image 
        //image = Bitmap.createScaledBitmap(image,image.getWidth(),image.getHeight(), true); 
        image = Bitmap.createBitmap(image, 0, 0, image.getWidth(), image.getHeight(), mat, true); //removing rotations 
       } 
       else{ 
        mat.preRotate(-90);//removing rotations of image 
        //image = Bitmap.createScaledBitmap(image,image.getWidth(),image.getHeight(), true); 
        image = Bitmap.createBitmap(image, 0, 0, image.getWidth(), image.getHeight(), mat, true); //removing rotations 
       } 

我的问题是我得到的图像是像缩略图像比我做了这么多谷歌搜索,发现这个链接 http://dharmendra4android.blogspot.in/2012/04/save-captured-image-to-applications.html 但我无法实现它。如果任何机构将提供任何示例项目或任何简单的解决方案,这将是巨大的帮助为了这 。

回答

0

这个问题很可能出现在您要从Intent中提取的数据中。你从哪里取得这个......这是什么意图?

+0

我从 – krishnendra

+0

提取数据onActivityResult(int requestCode,int resultCode,Intent intent) – krishnendra

+0

但问题是我得到的图像质量很低 – krishnendra

相关问题