当前位置: 首页 > java >正文

学会使用ai作图

SVG

即可缩放矢量图形(Scalable Vector Graphics),是一种基于可扩展标记语言(XML)的矢量图形格式。用代码描述矢量图形,你可以把它理解成“用文字画图”。和常见的JPG、PNG等位图完全不同,天生为网页而生,可玩性更高一些。

<svg width="200" height="100" xmlns="http://www.w3.org/2000/svg"><rect x="50" y="20" width="100" height="60" fill="red" />
</svg>

对于一个svg的样式,可以内嵌html显示或者用浏览器直接打开编辑好的.svg文件,所以这里让ai直接生成完整的svg代码来实现用户良好的图像。

AI prompt

根据要求绘制各种图片,如流程图等
以SVG形式给出
你的绘图遵循以下原则
1. 尽量美观,配色简洁舒适
2. 保证局部的对称和居中,尤其是箭头以及箭头上的文字
3. 不要使用曲线
你的背景可以参考这个:
<!-- 渐变背景 -->
<defs>
<linearGradient id="bgGradient" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#f8f9fa;stop-opacity:1" />
<stop offset="100%" style="stop-color:#e9ecef;stop-opacity:1" />
</linearGradient>
<linearGradient id="stackGradient" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#e9f2ff;stop-opacity:1" />
<stop offset="100%" style="stop-color:#d7e5f5;stop-opacity:1" />
</linearGradient>
<filter id="shadow" x="-10%" y="-10%" width="120%" height="120%">
<feDropShadow dx="3" dy="3" stdDeviation="3" flood-opacity="0.2"/>
</filter>
<!-- 定义箭头 -->
<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#495057" />
</marker>
</defs>

示例

  1. 任务
我需要了解mysql主从复制架构完整流程,需要有详细的文字介绍根据要求绘制各种图片,如流程图等
以SVG形式给出
你的绘图遵循以下原则
1. 尽量美观,配色简洁舒适
2. 保证局部的对称和居中,尤其是箭头以及箭头上的文字
3.不要使用曲线
你的背景可以参考这个:
<!-- 渐变背景 -->
<defs>
<linearGradient id="bgGradient" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#f8f9fa;stop-opacity:1" />
<stop offset="100%" style="stop-color:#e9ecef;stop-opacity:1" />
</linearGradient>
<linearGradient id="stackGradient" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color:#e9f2ff;stop-opacity:1" />
<stop offset="100%" style="stop-color:#d7e5f5;stop-opacity:1" />
</linearGradient>
<filter id="shadow" x="-10%" y="-10%" width="120%" height="120%">
<feDropShadow dx="3" dy="3" stdDeviation="3" flood-opacity="0.2"/>
</filter>
<!-- 定义箭头 -->
<marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
<polygon points="0 0, 10 3.5, 0 7" fill="#495057" />
</marker>
</defs>
  1. 根据ai生成的svg代码进行预览
    这里可以用一些在线的svg解析网站或者自己保存为svg文件预览。
    生成代码如下:
<svg width="800" height="600" viewBox="0 0 800 600" xmlns="http://www.w3.org/2000/svg"><!-- 引用用户提供的渐变和箭头定义 --><defs><linearGradient id="bgGradient" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:#f8f9fa;stop-opacity:1" /><stop offset="100%" style="stop-color:#e9ecef;stop-opacity:1" /></linearGradient><marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto"><polygon points="0 0, 10 3.5, 0 7" fill="#495057" /></marker></defs><!-- 背景 --><rect width="100%" height="100%" fill="url(#bgGradient)" /><!-- 主库组件 --><g transform="translate(100, 150)"><rect x="0" y="0" width="200" height="300" rx="10" fill="#fff" filter="url(#shadow)" /><text x="100" y="30" text-anchor="middle" font-size="16" fill="#2d3436">Master</text><rect x="20" y="60" width="160" height="40" fill="#e9f2ff" rx="5" /><text x="100" y="85" text-anchor="middle" font-size="14">Binlog</text><rect x="20" y="120" width="160" height="40" fill="#d7e5f5" rx="5" /><text x="100" y="145" text-anchor="middle" font-size="14">Binlog Dump线程</text></g><!-- 从库组件 --><g transform="translate(500, 150)"><rect x="0" y="0" width="200" height="300" rx="10" fill="#fff" filter="url(#shadow)" /><text x="100" y="30" text-anchor="middle" font-size="16" fill="#2d3436">Slave</text><rect x="20" y="60" width="160" height="40" fill="#e9f2ff" rx="5" /><text x="100" y="85" text-anchor="middle" font-size="14">Relay Log</text><rect x="20" y="120" width="160" height="40" fill="#d7e5f5" rx="5" /><text x="100" y="145" text-anchor="middle" font-size="14">I/O线程</text><rect x="20" y="180" width="160" height="40" fill="#d7e5f5" rx="5" /><text x="100" y="205" text-anchor="middle" font-size="14">SQL线程</text></g><!-- 箭头与流程标签 --><path d="M300 200 L500 200" stroke="#495057" stroke-width="2" marker-end="url(#arrowhead)" /><text x="400" y="190" text-anchor="middle" font-size="12" fill="#495057">Binlog事件传输</text><path d="M300 250 L500 250" stroke="#495057" stroke-width="2" marker-end="url(#arrowhead)" /><text x="400" y="240" text-anchor="middle" font-size="12" fill="#495057">ACK确认(半同步)</text>
</svg>
  1. 示例图片如下
    在这里插入图片描述
http://www.xdnf.cn/news/6097.html

相关文章:

  • 腾讯 IMA 工作台升级:新增知识库广场与 @提问功能
  • 标签部件(lv_label)
  • 企业数字化转型背景下的企业知识管理挑战与经验杂谈
  • 如何迁移 WSL 卸载 Ubuntu WSL
  • 数据库常见故障排查
  • 网络协议分析 实验六 TCP和端口扫描
  • web第三次课后作业--基于JDBC对mysql数据库的增删查改操作
  • 51单片机——交通指示灯控制器设计
  • 前端安全:XSS、CSRF 防御与最佳实践
  • JavaSwing之-JDialog
  • C++类和对象练习:Date类实现日期的差,比较日期的大小,日期的前置后置++,--,输入输出Date类,对默认函数的练习。
  • 数据科学和机器学习的“看家兵器”——pandas模块 之一
  • Docker Compose 的安装方法
  • 使用mermaid 语言绘画时序图和链路图
  • 基于 TensorFlow 框架的联邦学习可穿戴设备健康数据个性化健康管理平台研究
  • Tensorflow2保存和加载模型
  • 2025年PMP 学习十二 第9章 项目资源管理
  • 02_Servlet
  • .Net HttpClient 使用代理功能
  • Leetcode (力扣)做题记录 hot100(62,64,287,108)
  • C#调用C++dll 过程记录
  • 技术债务积累,如何进行有效管理
  • C++ 日志输出(宏定义)
  • 无人机数据处理与特征提取技术分析!
  • 劫持__security_check_cookie
  • 入门OpenTelemetry——部署OpenTelemetry
  • 分布式1(cap base理论 锁 事务 幂等性 rpc)
  • 微信小程序之将轮播图设计为组件
  • “强强联手,智启未来”凯创未来与绿算技术共筑高端智能家居及智能照明领域新生态
  • 【Alist+RaiDrive挂载网盘到本地磁盘】