当前位置:网站首页>Fabric. How to use js brush?
Fabric. How to use js brush?
2022-06-28 10:14:00 【InfoQ】
Brief introduction
Fabric.jsFabricFabric.js 5.2.1Common configuration
start

<canvas id="c" width="600" height="400" style="border: 1px solid #ccc;"></canvas>
<!-- introduce Fabric.js -->
<script src="https://cdn.bootcdn.net/ajax/libs/fabric.js/521/fabric.js"></script>
<script>
const canvas = new fabric.Canvas('c', {
isDrawingMode: true // Turn on painting mode
})
</script>
isDrawingModetrueisDrawingModetrueisDrawingModecanvas.isDrawingMode = trueSet the brush width

// Omit “ start ” Code
canvas.freeDrawingBrush.width = 20 // The width of the brush
widthSet brush color

// Omit “ start ” Code
canvas.freeDrawingBrush.width = 20 // The width of the brush
canvas.freeDrawingBrush.color = 'pink' // Brush color
Dotted line

// Omit “ start ” Code
canvas.freeDrawingBrush.width = 20 // The width of the brush
canvas.freeDrawingBrush.strokeDashArray = [20, 50] // Stroke dash array
strokeDashArrayProjection

// Omit “ start ” Code
canvas.freeDrawingBrush.width = 20 // The width of the brush
// Brush projection
canvas.freeDrawingBrush.shadow = new fabric.Shadow({
blur: 10, // The degree of eclosion
offsetX: 10, // x Shaft offset
offsetY: 10, // y Shaft offset
color: '#30e3ca' // Projection color
})
Freehand painting is limited to canvas size

// Omit “ start ” Code
canvas.freeDrawingBrush.width = 20 // The width of the brush
canvas.freeDrawingBrush.limitedToCanvasSize = true // When “ true” when , Freehand painting is limited to canvas size .
Brush style at the end of the line
canvas.freeDrawingBrush.strokeLineCap = 'round'
roundbuttsquareroundThe corner style of the brush
canvas.freeDrawingBrush.strokeLineJoin = 'miter'
miterbevelroundSet the maximum miter length of the brush
canvas.freeDrawingBrush.strokeLineJoin = 'miter' // The corner style of the brush
canvas.freeDrawingBrush.strokeMiterLimit = 10 // Maximum miter length
strokeMiterLimitstrokeLineJoinmiterlong-winded
Fabric.js- On-line PS Drawing board
- Online correction operation
Fabric.jsFabric.jsFabric.jsCode warehouse
边栏推荐
- Read PDF Text and write excel operation
- Chapter 5 trees and binary trees
- Instant messaging and BS architecture simulation of TCP practical cases
- 再見!IE瀏覽器,這條路由Edge替IE繼續走下去
- Sqlcmd database connection error
- On the influence of small program on the digitalization of media industry
- [200 opencv routines] 213 Draw circle
- idea连接sql sever失败
- PMP Exam key summary VI - chart arrangement
- [unity] built in rendering pipeline to URP
猜你喜欢
![[Unity][ECS]学习笔记(二)](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[Unity][ECS]学习笔记(二)

组合模式(Composite Pattern)

Composite pattern

满电出发加速品牌焕新,长安电动电气化产品吹响“集结号”

SQL中的DQL、DML、DDL和DCL是怎么区分和定义的

Bridge mode

sqlcmd 连接数据库报错

Caffeine cache, the king of cache, has stronger performance than guava
![[happy Lantern Festival] guessing lantern riddles eating lantern festival full of vitality ~ (with lantern riddle guessing games)](/img/04/454bede0944f56ba69cddf6b237392.jpg)
[happy Lantern Festival] guessing lantern riddles eating lantern festival full of vitality ~ (with lantern riddle guessing games)

The boss asked me to write an app automation -- yaml file reading -- with the whole framework source code attached
随机推荐
使用 ABAP 操作 Excel 的几种方法
通过PyTorch构建的LeNet-5网络对手写数字进行训练和识别
Interface automation framework scaffolding - Implementation of parametric tools
Resolution: overview of decentralized hosting solution
如图 用sql行转列 图一原表,图二希望转换后
Adapter mode
Install using snap in opencloudos NET 6
Numpy array: join, flatten, and add dimensions
请教下, 我在本地idea运行flinkcdc的mysql到mysql全量同步,这个是在我本地ide
Abnormal occurrence and solution
Comprehensive evaluation of outline note taking software workflow: advantages, disadvantages and evaluation
读取pdf文字和excel写入操作
[unity] built in rendering pipeline to URP
ECS MySQL query is slow
Decorator
Installing redis under Linux and windows (ultra detailed graphic tutorial)
Starting from full power to accelerate brand renewal, Chang'an electric and electrification products sound the "assembly number"
4 methods for exception handling
Please consult me. I run the MYSQL to MySQL full synchronization of flykcdc in my local ide. This is in my local ide
Restful style