# thinkphp6-avatars **Repository Path**: tojeekup/thinkphp6-avatars ## Basic Information - **Project Name**: thinkphp6-avatars - **Description**: php8 可用的头像生成器 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-11 - **Last Updated**: 2021-11-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 广州技客 Thinkphp6 工具类 ======================= ### 该工具来源于网络,因为项目使用php8,之前的包有问题,故自己修改了下复制了个供高版本的有需要客户使用 ### 安装 ~~~ composer require ric/thinkphp6-avatars ~~~ ```php ``` Or initialize with composer: ```json { "require": { "lincanbin/material-design-avatars": "*.*" } } ``` ```php ``` Usage ------------ #### Show you avatar in the browser ```php Output2Browser(); ?> ``` ```php Output2Browser($OutputSize); // Output Base64 encoded image data. $Avatar->Output2Base64($OutputSize); // Get an image resource identifier. $Avatar->Output2ImageResource($OutputSize); ?> ``` #### Save avatar to a file ```php Save('./avatars/Avatar.png'); //You can resize the size you want to save again here. $Avatar->Save('./avatars/Avatar256.png', 256); $Avatar->Save('./avatars/Avatar128.png', 128); $Avatar->Save('./avatars/Avatar64.png', 64); ?> ``` #### Free memory ```php Free(); ?> ```