diff --git a/en/react-native-image-sequence-2.md b/en/react-native-image-sequence-2.md index 820e29b95b261e468fbe9e8ddb00fed653f00bd6..850033763715d26226ae6ee9146c586bb537c8ae 100644 --- a/en/react-native-image-sequence-2.md +++ b/en/react-native-image-sequence-2.md @@ -40,240 +40,39 @@ The following code shows the basic use scenario of the repository: > [!WARNING] The name of the imported repository remains unchanged. -TestDemo.tsx - -```js -import React, { useState } from "react"; -import { SafeAreaView, StyleSheet } from "react-native-harmony"; -import { View, Text, Switch, TextInput, Button } from "react-native"; -import TestDemo2 from "./TestDemo2"; - -const images = [ - { uri: "https://octodex.github.com/images/stormtroopocat.jpg" }, - { uri: 'https://octodex.github.com/images/saint_nictocat.jpg' }, - require("./assets/2.jpg"), - require("./assets/3.jpg"), - require("./assets/4.jpg"), - require("./assets/5.jpg"), - require("./assets/6.jpg"), -]; - -export interface sequenceType { - images: NodeRequire[]; - loop: boolean; - startFrameIndex: number; - framesPerSecond: number; - downsampleWidth: number; - downsampleHeight: number; -} - -const ImageSequenceDemo = (props: any) => { - const [loopData, setLoopData] = useState(false); - const [isShow, setIsShow] = useState(false); - const [winWidth, setWinWidth] = useState(300); - const [winHeight, setWinHeight] = useState(200); - const [downsampleWidth, setDownSampleWidth] = useState(-1); - const [downsampleHeight, setDownSampleHeight] = useState(-1); - - // Set Sampling Width - const inputSampleWidth = (value: string) => { - if (isNaN(Number(value))) { - return; - } - setDownSampleWidth(Number(value)); - }; - - // Set Sampling Height - const inputSampleHeight = (value: string) => { - if (isNaN(Number(value))) { - return; - } - setDownSampleHeight(Number(value)); - }; - - // Set Starting Position - const [startFrameIndex, setFrameIndex] = useState(0); - const inputStartFrameIndex = (value: string) => { - if (isNaN(Number(value))) { - return; - } - let _value = Number(value); - if (Number(value) > images.length) { - _value = 0; - } - setFrameIndex(_value); - }; - - // Set Rate - const [framesPerSecond, setFramesPerSecond] = useState(24); - const inputFramesPerSecond = (value: string) => { - if (isNaN(Number(value))) { - return; - } - let _value = Number(value); - if (Number(value) <= 0) { - _value = 24; - } - setFramesPerSecond(_value); - }; - - const buttonIsShow = () => { - setIsShow(!isShow); - }; - - const inputSetWinWidth = (value: string) => { - if (isNaN(Number(value))) { - return; - } - setWinWidth(Number(value)); - }; - - const inputSetWinHeight = (value: string) => { - if (isNaN(Number(value))) { - return; - } - setWinHeight(Number(value)); - }; - - return ( - - - - - Current view size:width: {winWidth}, height:{winHeight} - - - Activate Loop: setLoopData(value)}> - - - Image Width/Height: - - inputSetWinWidth(value)} - defaultValue="300" - keyboardType="numeric" - /> - inputSetWinHeight(value)} - defaultValue="200" - keyboardType="numeric" - /> - - - Initial Position: - inputStartFrameIndex(value)} - defaultValue="0" - keyboardType="numeric" - /> - Playback Speed: - inputFramesPerSecond(value)} - defaultValue="24" - keyboardType="numeric" - /> - - Sampling Width/Height: - - inputSampleWidth(value)} defaultValue='-1' keyboardType='default' /> - inputSampleHeight(value)} defaultValue='-1' keyboardType='default' /> - - - - {!isShow ? ( -