Skip to content

sundou/react-native-image-mark-pan-zoom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-native-image-mark-pan-zoom

Getting Started

Installation

npm i react-native-image-mark-pan-zoom --save

Basic Usage

import React, { Component } from 'react';
import {
	AppRegistry,
	StyleSheet,
	Text,
	View,
	Modal
} from 'react-native';

import {ImageZoom ,Mark} from 'react-native-image-mark-pan-zoom';

class ImageViewer extends React.Component {
render() {
    return (
        <View style={{flex: 1}}>
            <ImageZoom 
                ref={(r) => this.ImageZoom=r}
                cropWidth={Dimensions.get('window').width}
                cropHeight={Dimensions.get('window').height}
                zoomRate={0.5}
                imageWidth={200}
                imageHeight={200}
            >

                <Image style={{width:200, height:200,}}
                    source={require('./test.jpg')}
                >
    
                    <Mark x={0} y={0} 
                        onPress={() => {
                        this.ImageZoom.zoomIn();
                        }}
                    >
                        <View style={{width:50,height:51,backgroundColor:'yellow'}}/>
                    </Mark>

                    <Mark x={50} y={50} 
                        onPress={() => {
                        this.ImageZoom.zoomOut();
                        }}
                    >
                        <View style={{width:50,height:51,backgroundColor:'yellow'}}/>
                    </Mark>

                </Image>
            </ImageZoom>

        </View>
    )}
}

AppRegistry.registerComponent('myproject', () => ImageViewer);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published