我正在用Unity3D創建2D遊戲,但我對它很陌生。 我想繪製一個單色背景,在它前面有一些小精靈。 我發現這個代碼: using UnityEngine;
using System.Collections;
public class GUIRect : MonoBehaviour {
public Color color;
// Use this for initia
如何將單色bmp圖像文件(在我的情況下是16 * 16像素)轉換爲二進制格式?該代碼讀取位圖信息。我必須將像素信息存儲到一個數組中&它沒有正確存儲。我有共同的代碼 #pragma pack(push, 1)
typedef struct BitMap
{
short Signature;
long Reserved1;
long Reserved2;
long DataOff
我想將彩色圖像轉換爲單色,我認爲要循環所有像素,但我不知道如何測試它們是否明亮或黑暗。 for(int y=0;y<image.getHeight();y++){
for(int x=0;x<image.getWidth();x++){
int color=image.getRGB(x, y);
// ???how to test if its is