zoukankan      html  css  js  c++  java
  • UE4 保存为bitmap

        TArray<FColor> colorData;
        colorData.Init(FColor(0, 0, 255, 255), 1920 * 1080);

        for (int y = 0; y < 1920; y++)
        {
            for (int x = 0; x < 1080; x++)
            {
                int i = x + (y * 1080);
                colorData[i].R = binaryData[i * 4 + 0];
                colorData[i].G = binaryData[i * 4 + 1];
                colorData[i].B = binaryData[i * 4 + 2];
                colorData[i].A = binaryData[i * 4 + 3];
                count++;
            }
        }

    TCHAR* d = TEXT("E:/testJigou/b.bmp");


        bool success = FFileHelper::CreateBitmap(d,1920,1080, &colorData[0],nullptr);
        if (success == true)
        {
            GEngine->AddOnScreenDebugMessage(-1, 10.0f, FColor::Red, TEXT("chenggongla"));
            GEngine->AddOnScreenDebugMessage(-1, 10.0f, FColor::Red, FString::FromInt(count));

        }
        else
        {
            GEngine->AddOnScreenDebugMessage(-1, 10.0f, FColor::Red, TEXT("shibaila"));
        }

    需要include #include "FileHelper.h"

  • 相关阅读:
    MySQL 5.7.18 zip 文件安装过程
    Mysql 自定义随机字符串
    JAVA基本类型和引用类型
    初识JSP
    Java导出错误数据
    时序图的使用习惯
    Redis踩坑
    ES踩坑
    代码规范
    Git在公司的使用流程
  • 原文地址:https://www.cnblogs.com/litmin/p/7602856.html
Copyright © 2011-2022 走看看