• SOIL 创建图片


    #include <iostream>
    #include <string>
    using namespace std;
    #include "../../src/socket/TCPSocketEx.h"
    #include <cocos2d.h>
    using namespace cocos2d;
    #include "../../src/socket/Private/MemoryPool.h"
    #include "../../src/socket/ServerService.h"
    #include "external/xxtea/xxtea.h"
    #include "cocos/base/ccUtils.h"
    extern "C"
    {
    #include "md5/md5.h"
    }
    #include "SOIL2.h"


    int main()
    {
        const int w = 100;
        const int h = 100;
        const int size = w * h * 4;
        unsigned char data[size] = { 0 };
        
        for (int i = 0; i < size; i += 4)
        {
            data[i] = 255;//r
            data[i + 1] = 0;//g
            data[i + 2] = 0;//b
            data[i + 3] = 255;//a
        }

        auto ret = SOIL_save_image("D:/PriPro/NDKLIB/t.png", SOIL_SAVE_TYPE_PNG, w, h, SOIL_LOAD_RGBA, data);
        printf("ret %d ", ret);


        unsigned char buf[40000] = { 0 };
        int W, H, C;
        auto d = SOIL_load_image("D:/PriPro/NDKLIB/test.png", &W, &H, &C, 0);
        memcpy(buf, d,40000);





        int var = 0;
        return 0;
    }

  • 相关阅读:
    关于垂直居中
    linux 前后台程序切换
    mac 下jetbrains IDE系列IDE主题
    mac 安装命令行开发者工具
    python 安装MySQLdb mysql_config not fount
    error: command 'cc' failed with exit status 1
    sqllite 入门
    jieba分词
    zookeeper 故障重连机制
    深入学习 celery
  • 原文地址:https://www.cnblogs.com/YZFHKMS-X/p/13741409.html
Copyright © 2020-2023  润新知