Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to draw the frame of the current path with Mini Program

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

The knowledge points of this article "how to use Mini Program to draw the frame of the current path" are not quite understood by most people, so the editor summarizes the following contents for you. The content is detailed, the steps are clear, and it has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to use Mini Program to draw the frame of the current path" article.

CanvasContext.stroke definition

Draw the border of the current path. The default color is black.

The path drawn by Tip:stroke () is calculated from beginPath (), but does not include strokeRect (), as detailed in example 2.

Example const ctx = wx.createCanvasContext ('myCanvas') ctx.moveTo (10,10) ctx.lineTo (100,10) ctx.lineTo (100,100) ctx.stroke () ctx.draw () const ctx = wx.createCanvasContext (' myCanvas') / / begin pathctx.rect (10,10,100,30) ctx.setStrokeStyle ('yellow') ctx.stroke () / / begin another pathctx.beginPath () ctx.rect (10,40,100,30) / / only stoke this rect, not in current pathctx.setStrokeStyle (' blue') ctx.strokeRect (10 70,100,30) ctx.rect (10,100,100,30) / / it will stroke current pathctx.setStrokeStyle ('red') ctx.stroke () ctx.draw () above is the content of this article on "how to draw the frame of the current path with Mini Program" I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report