Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2021-1-capstone-design1
/
MAC_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이정민
2021-05-21 21:30:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8ecc3b6c37f7be4c2a5f456056eea5afc4408e6a
8ecc3b6c
1 parent
fb39548c
gif 생성
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
src/components/GifEditor.tsx
src/gif-generator/src/index.js
src/components/GifEditor.tsx
View file @
8ecc3b6
import { useEffect, useRef, useState } from "react";
import styled from "styled-components";
import { GifGenerator } from "gif-generator/src";
import TuiImageEditor from "tui-image-editor";
import "gif-generator/dist/gif-generator";
const GifEditor = ({ previewURL }) => {
// const [canvas, setCanvas] = useState<HTMLCanvasElement>();
...
...
@@ -59,6 +59,8 @@ const GifEditor = ({ previewURL }) => {
const gifGenerator = new GifGenerator(imageEditor._graphics.getCanvas());
gifGenerator.make().then(
(blob) => {
console.log("blob", blob);
console.log(window.URL.createObjectURL(blob));
window.open(window.URL.createObjectURL(blob));
},
(error) => {
...
...
src/gif-generator/src/index.js
View file @
8ecc3b6
...
...
@@ -51,7 +51,7 @@ export class GifGenerator {
const
objs
=
[];
fabricObjs
.
map
((
fabricObj
)
=>
{
if
(
fabricObj
instanceof
fabric
.
Path
)
{
if
(
fabricObj
.
path
!==
undefined
)
{
objs
.
push
(
new
Component
.
Brush
(
fabricObj
));
this
.
canvas
.
remove
(
fabricObj
);
}
else
if
(
fabricObj
.
text
!==
undefined
)
{
...
...
Please
register
or
login
to post a comment