#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\n", 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;
}

相关文章:

  • 2021-05-20
  • 2022-03-07
  • 2022-01-13
  • 2021-12-04
  • 2021-12-10
猜你喜欢
  • 2021-08-08
  • 2021-07-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2021-12-05
相关资源
相似解决方案