Code Monkey home page Code Monkey logo

Comments (7)

rt2zz avatar rt2zz commented on May 16, 2024 24

To display the base64 image (i.e. target: Camera.constants.CaptureTarget.memory) the code is roughly

<Image
  source={{
      isStatic: true,
      uri: 'data:image/jpeg;base64,'+base64image,
    }}
  style={{height: 100, width:100}}
  />

where base64image is the string returned by the capture method.

To display the target: disk image, the code is roughly

<Image
  source={{uri: imageURI, isStatic:true}}
  style={{width: 100, height: 100}}
  />

where imageURI is the string returned by the capture method.

You will probably need to play with the width/height, and resizeMode prop to get everything the way you want it.

from react-native-camera.

julienvincent avatar julienvincent commented on May 16, 2024 1

No nevermind, after reinstalling it works as expected

from react-native-camera.

antoinegrant avatar antoinegrant commented on May 16, 2024

That very helpful, thanks.

from react-native-camera.

Mayzie avatar Mayzie commented on May 16, 2024

Hi there,

This does not seem to work any longer on React Native 0.44 for Android. How can I achieve this (displaying a temp, or disk, image)?

from react-native-camera.

npomfret avatar npomfret commented on May 16, 2024

@Mayzie - what doesn't work? do you have an error or a stack trace from logcat?

from react-native-camera.

julienvincent avatar julienvincent commented on May 16, 2024

Can confirm this no longer works. No problems on a simulator, but does not work on a real device

from react-native-camera.

pablodance avatar pablodance commented on May 16, 2024

brilliant - thanks very much @rt2zz - saved me some head scratching..

from react-native-camera.

Related Issues (20)

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.