Guest User

Untitled

a guest
Dec 13th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. public CameraPreview (Context context)
  2. : base (context)
  3. {
  4. surfaceView = new SurfaceView (context);
  5.  
  6.  
  7. windowManager = Context.GetSystemService (Context.WindowService).JavaCast<IWindowManager> ();
  8.  
  9. IsPreviewing = false;
  10.  
  11. Bitmap drawingCache = surfaceView.DrawingCache;
  12. Bitmap bitmap = Bitmap.CreateBitmap(drawingCache);
  13.  
  14. for(int n = 0; n < 1000; n++) {bitmap.SetPixel(n,n,Color.Black); } //I created this for debugging purposes, just to check if everything works fine
  15.  
  16. holder = surfaceView.Holder;
  17.  
  18. holder.AddCallback (this);
  19. surfaceView = // HERE I HAVE TO CONVERT BITMAP INTO SURFACE
  20.  
  21. AddView (surfaceView);
  22. }
Add Comment
Please, Sign In to add comment