简体   繁体   中英

Display phone camera preview in windows application

Is it possible, and if so how, to make a desktop app either in java or c# that shows a preview of a phone camera connected through usb.

My idea is to stream a preview to a program that is run on desktop pc and scan a color from that preview, however as i said, i found no clue of how i could stream a camera preview to the app.

I've made some researches to be sure, and I am quite sure that there's no official way to do this kind of job as for now.

Actually there's a lot of stuff that should be taken care off in order to archive what you want. Please notice that i have not tested the following things so I cannot guarantee that the following are the exact steps to take.


Steps (not tested yet)

  1. First you will have to enstabilish a connection to your android Device, reference

  2. Once you have setted up the endpoints and your connection is alive you should make sure that you have permission to access the camera (on the new version of android it's a good practice checking for the permission at runtime as you cannot know if user revoked the permission)

  3. Streaming the data from the camera to the USB connection

On the other hand your WinApp should listen to the endpoint where you device is sending the data and then parse from bytes[] to image.

Again this is pure theory and you should checkout the reference for a deep insight, that being said best of luck :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM