GithubHelp home page GithubHelp logo

yoursoultree / androidpickeroperations Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sharkhack/androidpickeroperations

0.0 2.0 0.0 176 KB

Air Native Extension for mobile camera and gallery features (Android image picker/camera or image save to gallery/custom gallery)

License: MIT License

androidpickeroperations's Introduction

AndroidPickerOperations NativeExtension

Air Native Extension for mobile camera and gallery features (Android picker and save gallery)

  • This is an Air native extension that allows you to display native UI to pick images from the gallery or take a picture with the camera on Android.

  • This project supports Google+ & Picasa Photos

  • Save BitmapData to Gallery or Custom gallery (android)

  • Supports create custom gallery folder

  • Supports media connection scanner…

  • This ane fixes camera and cameraroll (pick or save) memory leak problem.

It has been developed by Azer Bulbul

USAGE

//Camera or Gallery
  var androidCamera:Camera = new Camera();
  androidCamera.addEventListener(StatusEvent.STATUS, onResult);
  //if camera image capture = true … if open gallery image picker capture=false
  var isCameraCapture:boolean = false; 
  var issupprt:Boolean =androidCamera.browseForImage(isCameraCapture);
  if(issupprt == false){/*not supported code here*/}
  protected function onResult(e:StatusEvent):void{
		trace("event:"+e.code + " - level:"+e.level);
		if(e.code == 'IMAGEPATH' && e.level != ""){
			var androidimagefilepath:String =  e.level;
  		// now call the file read code….
		} else{ 
			//error code here....
		}
   }

//save BitmapData

	var originalBd:BitmapData = new BitmapData(100,100,false,0x000000);

  // I change it because java bitmapdata channels are different from the ones on AS3

  var bd = new bitmapdata(100,100,false,0x000000);
	bd.copyChannel(originalBd,originalBd.rect,new Point(0,0),BitmapDataChannel.BLUE,BitmapDataChannel.RED);
  bd.copyChannel(originalBd,originalBd.rect,new Point(0,0),BitmapDataChannel.GREEN,BitmapDataChannel.GREEN);
  bd.copyChannel(originalBd,originalBd.rect,new Point(0,0),BitmapDataChannel.RED,BitmapDataChannel.BLUE);
  
  var androidCamera:Camera = new Camera();
  androidCamera.addEventListener(StatusEvent.STATUS, onResult);
  var isWriteToCustomFolder:boolean = false; 
  androidCamere.bmpSave(bd,isWriteToCustomFolder);

	protected function onResult(e:StatusEvent):void{
		trace("event:"+e.code + " - level:"+e.level);
		if(e.code == 'err'){
			//didnt save image...
		} else{ 
			//saved ok code here....
		}
	}

androidpickeroperations's People

Contributors

sharkhack avatar

Watchers

James Cloos avatar JEONG WON UNG avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.