user-0 提问: 用语言编写生成三幅分辨率为800*600的bmp图片，颜色分别为红绿蓝。萌新求大神支招

回复:
user: user-0
content: 用C语言呢。。。。

user: user-0
content: 用C语言编写。有具体的代码吗？

user: user-1
content: 先查询bmp图像的格式，然后照着格式一个字节一个字节写就可以了

user: user-2
content: 引用 2 楼 u010165006 的回复:http://download.csdn.net/detail/u010165006/9688692  图形用户界面可以学习C++ Builder，入门比较容易。 仅供参考： 初学者学习C++ Builder第一个程序（模拟聊天室），经典！ http://blog.163.com/tab_98/blog/static/11924097201693033057497/ 从C语言的菜单界面管理系统到C++ Builder的图形用户界面，一个简单的电话簿Demo例子 http://blog.163.com/tab_98/blog/static/1192409720158673337998/ C++ Builder写的《ZEC 纸牌游戏21点》 http://blog.163.com/tab_98/blog/static/119240972016115113039304/ C++ Builder写的《ZEC 僵尸版打地鼠》 http://blog.163.com/tab_98/blog/static/11924097201601084117748/

user: user-3
content: 仅供参考：#pragma comment(lib,"gdi32") #include <windows.h> #include <stdio.h>  int main() {     const DWORD uWidth = 18 + 17 * 256, uHeight = 18 + 17 * 128;      PBITMAPINFO pbmi = (PBITMAPINFO) LocalAlloc (LPTR, sizeof (BITMAPINFOHEADER) + sizeof (RGBQUAD) * 2);     pbmi->bmiHeader.biSize = sizeof (BITMAPINFOHEADER);     pbmi->bmiHeader.biWidth = uWidth;     pbmi->bmiHeader.biHeight = uHeight;     pbmi->bmiHeader.biPlanes = 1;     pbmi->bmiHeader.biBitCount = 1;     pbmi->bmiHeader.biSizeImage = ((uWidth + 31) & ~31) / 8 * uHeight;     pbmi->bmiColors[0].rgbBlue = 0;     pbmi->bmiColors[0].rgbGreen = 0;     pbmi->bmiColors[0].rgbRed = 0;     pbmi->bmiColors[1].rgbBlue = 255;     pbmi->bmiColors[1].rgbGreen = 255;     pbmi->bmiColors[1].rgbRed = 255;      HDC hDC = CreateCompatibleDC (0);     void * pvBits;     HBITMAP hBitmap = CreateDIBSection (hDC, pbmi, 0, &pvBits, NULL, 0);     SelectObject (hDC, hBitmap);     HFONT hFont = CreateFont (16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "宋体"); //  HFONT hFont = CreateFont (16, 0, 0, 0, 0, 0, 0, 0, SHIFTJIS_CHARSET, 0, 0, 0, 0, "宋体");     SelectObject (hDC, hFont);     BitBlt (hDC, 0, 0, uWidth, uHeight, NULL, 0, 0, WHITENESS);      char c[4];     int i, j;     for (i = 128; i < 256; i++) {         sprintf (c, "%02X", i);         TextOut (hDC, 1, (i - 127) * 17 + 1, c, 2);     }     for (j = 0; j < 256; j++) {         sprintf (c, "%02X", j);         TextOut (hDC, (j + 1)* 17 + 1, 1, c, 2);     }     for (i = 128; i < 256; i++) {         for (j = 0; j < 256; j++) {             c[0] = (char) i;             c[1] = (char) j;             TextOut (hDC, (j + 1) * 17 + 1, (i - 127) * 17 + 1, c, 2);         }     }     for (i = 0; i < 130; i++) {         MoveToEx (hDC, 0, i * 17, NULL);         LineTo (hDC, uWidth, i * 17);     }     for (j = 0; j < 258; j++) {         MoveToEx (hDC, j * 17, 0, NULL);         LineTo (hDC, j * 17, uHeight);     }      BITMAPFILEHEADER bmfh;     bmfh.bfType = *(PWORD) "BM";     bmfh.bfReserved1 = 0;     bmfh.bfReserved2 = 0;     bmfh.bfOffBits = sizeof (BITMAPFILEHEADER) + sizeof (BITMAPINFOHEADER) + sizeof (RGBQUAD) * 2;     bmfh.bfSize = bmfh.bfOffBits + pbmi->bmiHeader.biSizeImage;      HANDLE hFile = CreateFile ("goal.bmp", GENERIC_WRITE, 0, 0, CREATE_ALWAYS, 0, 0);     if (hFile != INVALID_HANDLE_VALUE) {         DWORD dwWritten;         WriteFile (hFile, &bmfh, sizeof (BITMAPFILEHEADER), &dwWritten, NULL);         WriteFile (hFile, pbmi, sizeof (BITMAPINFOHEADER) + sizeof (RGBQUAD) * 2, &dwWritten, NULL);         WriteFile (hFile, pvBits, pbmi->bmiHeader.biSizeImage, &dwWritten, NULL);          CloseHandle (hFile);     }      DeleteObject (hFont);     DeleteObject (hBitmap);     DeleteDC (hDC);     LocalFree (pbmi);      return 0; }

user: user-2
content: 引用 2 楼 u010165006 的回复:http://download.csdn.net/detail/u010165006/9688692  参考： http://blog.163.com/tab_98/  图形用户界面可以学习C++ Builder，入门比较容易。 仅供参考： 初学者学习C++ Builder第一个程序（模拟聊天室），经典！ http://blog.163.com/tab_98/blog/static/11924097201693033057497/ 从C语言的菜单界面管理系统到C++ Builder的图形用户界面，一个简单的电话簿Demo例子 http://blog.163.com/tab_98/blog/static/1192409720158673337998/ 学C++还是C#、Java？ http://blog.163.com/tab_98/blog/static/11924097201511274543737/ 《C++ Builder（BCB）从初学到入门》 http://blog.163.com/tab_98/blog/static/119240972016157466626/

user: user-2
content: http://download.csdn.net/detail/u010165006/9688692