Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about image sizes #5

Open
DroneKid opened this issue Dec 9, 2016 · 2 comments
Open

Question about image sizes #5

DroneKid opened this issue Dec 9, 2016 · 2 comments

Comments

@DroneKid
Copy link

DroneKid commented Dec 9, 2016

Hi!

I'm trying to pan and zoom big image (1000x1000). So I set imageWidth & imageHeight to 1000 and imageContainer sizes to the Dimensions values. It pans ok, but pinch-zooming is funky. on iOs it just pans and does not zoom, on Android it crops the image to the container size.

Could you please advise if I'm doing anything wrong?

Thanks,
A.

@superandrew213
Copy link

Post your code so we can see

@DroneKid
Copy link
Author

DroneKid commented Dec 9, 2016

import React, { Component } from 'react';
import {
  View,
  Text,
  Image,
  Dimensions,
} from 'react-native';
import ViewEditor from 'react-native-view-editor';
const { width, height } = Dimensions.get('window');

const uri = 'https://res.cloudinary.com/dtihkk6cr/image/upload/'
  + 'v1481234249/permission_form_page_1_hqx6to.png';

const imgWidth = 773;
const imgHeight = 1000;

console.log(width, height);

export default class App extends Component {
  render() {
    return (
      <ViewEditor
        imageWidth={imgWidth}
        imageHeight={imgHeight}
        imageContainerWidth={width}
        imageContainerHeight={height}
      >
        {() => (
          <Image
            style={{ position: 'relative', width: imgWidth, height: imgHeight }}
            source={{ uri }}
          >
          </Image>
        )}
      </ViewEditor>
    );
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants