
package li.itcc.hackathon2014.Selfie;

import li.itcc.hackathon2014.AbstractTourFragment;
import li.itcc.hackathon2014.R;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.Button;

public class SelfieFragment extends AbstractTourFragment implements OnClickListener {

    /**
     * Returns a new instance of this fragment for the given section number.
     */
    public static SelfieFragment newInstance(int tourNumber, int tourPage) {
        SelfieFragment fragment = new SelfieFragment();
        fragment.setTourArguments(tourNumber, tourPage);
        return fragment;
    }

    public SelfieFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_selfie, container,
                false);
        Button nextButton = (Button)rootView.findViewById(R.id.next_button);
        setNextButton(nextButton);
        
        final Button testButton = (Button) rootView.findViewById(R.id.intro_button);
        testButton.setOnClickListener(this);
        return rootView;
    
    }
   
public void Photo(View view) {
String paths = null;
Logic x = new Logic(this);
paths = x.TakePictureIntent();
}

@Override
public void onClick(View v) {
Photo(v);    
}

}

@@ -116,16 +116,150 @@
 2014.R;%0A
+import android.graphics.Bitmap;%0Aimport android.graphics.BitmapFactory;%0Aimport android.graphics.Canvas;%0Aimport android.graphics.Paint;%0A
 import a
@@ -1149,16 +1149,17 @@
 (Button)
+ 
 rootView
@@ -1226,24 +1226,16 @@
 utton);%0A
-        
 %0A       
@@ -1386,23 +1386,20 @@
 ew;%0A
-    
 %0A    %7D%0A
+%0A 
    
-%0A
 publ
@@ -1425,16 +1425,24 @@
 view) %7B%0A
+        
 String p
@@ -1454,16 +1454,24 @@
 = null;%0A
+        
 Logic x 
@@ -1489,16 +1489,24 @@
 (this);%0A
+        
 paths = 
@@ -1528,19 +1528,27 @@
 tent();%0A
-%7D%0A%0A
+    %7D%0A%0A    
 @Overrid
@@ -1549,16 +1549,20 @@
 verride%0A
+    
 public v
@@ -1583,16 +1583,24 @@
 ew v) %7B%0A
+        
 Photo(v)
@@ -1604,13 +1604,1337 @@
 (v);
+%0A
     
-%0A
+%7D%0A%0A    public void generate_bmp() %7B%0A        Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.pic1);%0A    %7D%0A%0A    // STAMP ITCC hinzufuegen%0A    public void stamp() %7B%0A        // definieren .. pfad zum bitmap%0A        Bitmap bitmap1 = null;%0A        Bitmap bitmap2 = null;%0A        Bitmap resultBitmap = Bitmap.createBitmap(bitmap1.getWidth(), bitmap1.getHeight(),%0A                Bitmap.Config.ARGB_8888);%0A        Canvas c = new Canvas(resultBitmap);%0A        c.drawBitmap(bitmap1, 0, 0, null);%0A        Paint p = new Paint();%0A        p.setAlpha(127);%0A        c.drawBitmap(bitmap2, 0, 0, p);%0A    %7D // Funktion ende%0A      // TO DO: bmp 2 jpeg und speichern%0A%0A    protected void onDraw(Canvas canvas) %7B%0A        Paint paint = new Paint();%0A        canvas.drawColor(Color.GRAY);%0A        // you need to insert some image flower_blue into res/drawable folder%0A        Bitmap b = BitmapFactory.decodeResource(getResources(), R.drawable.Selfie);%0A        // Best of quality is 80 and more, 3 is very low quality of image%0A        Bitmap bJPGcompress = codec(b, Bitmap.CompressFormat.JPEG, 80);%0A        // get dimension of bitmap getHeight() getWidth()%0A        int h = b.getHeight();%0A        canvas.drawBitmap(b, 10, 10, paint); // %3C-- gr%C3%B6sse es Bitmaps?%0A        canvas.drawBitmap(bJPGcompress, 10, 10 + h + 10, paint);%0A    
 %7D%0A%0A%7D

Update Bitmap Plon33r