Images did not show

BEFORE    
https://www.dropbox.com/s/kghrovmm1bcw61g/Screenshot_2014-05-20-08-26-07.jpg

SAVED      
https://www.dropbox.com/s/h8nudprv85b0sy3/SKELETON-Jacqui%20Fedor-DJ-2014-05-20%2008%3A26%3A15.png?m=


On May 20, 2014, at 8:29 AM, Barry Fawthrop <[email protected]> wrote:

> I'm confused as to why the alignment changes when the View is saved
> 
> Here is my layout
> 
> <FrameLayout         android:layout_width="1000dp"  
> android:layout_height="707dp"  android:layout_marginLeft="140dp"  
> android:layout_marginTop="670dp"  android:id="@+id/home"  
> android:background="@color/black"  >
>    <ImageView        android:layout_width="1000dp"  
> android:layout_height="707dp"  android:background="@color/brown"              
>     android:id="@+id/graphic"      android:src="@drawable/anatomy_hooves"  /> 
>    
>    <com.TouchPanel   android:layout_width="1000dp"  
> android:layout_height="707dp"  
> android:background="@android:color/transparent"    
> android:id="@+id/touchLayer"   />
>    <com.PenPanel     android:layout_width="1000dp"  
> android:layout_height="707dp"  
> android:background="@android:color/transparent"    android:id="@+id/penLayer" 
>     />
> </FrameLayout> 
> 
> 
> 
> Here is the code that saves
> 
> FrameLayout home                     = (FrameLayout)findViewById(R.id.home);  
>         home.layout(0, 0, 1500, 1061);
> ...
> ...
> home.layout(0, 0, 1500, 1061);
> home.setDrawingCacheEnabled(true);
> Bitmap bmp = Bitmap.createBitmap(home.getDrawingCache());
> Log.i("VISIT","Bitmap    " + bmp.getWidth() + " x " + bmp.getHeight() + "     
>  " + bmp.getDensity()  );
> try {
>       FileOutputStream out = new 
> FileOutputStream(Environment.getExternalStorageDirectory() + "/DCIM/Images/" 
> + skeletonFileName);
>       bmp.compress(Bitmap.CompressFormat.PNG, 100, out);
>       out.flush();
>       out.close();
>       Log.i("INFO","saved Skeleton to   ["+ skeletonFileName +"] ");
> } catch (Exception err) {
>       err.printStackTrace();
>       Log.e("INFO","Could Not save Skeleton to   ["+ skeletonFileName +"] ");
> }
> home.setDrawingCacheEnabled(false);
>               
> 
> Here is the screen BEFORE pressing the save Button
> 
> 
> Here is the resulting PNG file generated by executing the code
> 
> 
> 
> Why does the drawing shift  and rescale ?
> 
> What am I missing, how can I save the image as it appear on the screen
> 
> 
> Thanks in advance
> 
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to