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"

  • 相关阅读:
    Hive学习笔记三
    spark之RDD练习
    Python之QRCode
    Zookeeper学习笔记一
    Docker学习笔记一
    MapReduce异常:java.lang.ClassCastException: interface javax.xml.soap.Text
    Hive学习笔记二
    Hive学习笔记一
    5.线性回归算法
    4.K均值算法
  • 原文地址:https://www.cnblogs.com/litmin/p/7602856.html
Copyright © 2011-2022 走看看