Giter Site home page Giter Site logo

image2base64's Introduction

image2base64

An electron-vue project

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:9080
npm run dev

# build electron application for production (Mac)
npm run build:darwin

# build electron application for production (Windows)
npm run build:win32

# build electron application for production (Linux)
npm run build:linux


electron 小 demo,用到了 electron-vue 这个 vue-cli 模板,主要作用是将剪切板中的图片转成 base64 编码的,并通过一键复制成 img 标签或 markdown 的图片语法,可以通过滑块调整图片缩放和压缩率。

编写的目的是,Typora 没有方便的粘贴图片的办法,![Alt text][] 如果在其中写入本地图片的相对路径的话,导出成 html 会导致图片消失,另一种办法是在其中写入图片的 base64 编码。markdown 中调节图片大小根据编辑器的支持有不同的写法,我用的 typora 只支持基于 来调节因此我加上了滑动调节大小的功能,又因为转成 base64 后长度很长,因此使用 canvas.toDataURL 的 api 来进行压缩。

demo 的界面:

main_interface

This project was generated with electron-vue@1c165f7 using vue-cli. Documentation about the original structure can be found here.

image2base64's People

Contributors

honghaiyang avatar

Stargazers

 avatar  avatar yanstin avatar Nikolay Belykh avatar Seeker avatar Tenvi avatar  avatar  avatar crazyld avatar

Forkers

lc168 libin1991

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.