vc下的c程序如何控制像素的颜色?

来源:百度知道 编辑:UC知道 时间:2024/06/19 13:28:19
graph.h 函数找不到,用不了setpixel,请尽量不要用C++,俺没学过

// 自己看吧,不明白再问

// INCLUDES ///////////////////////////////////////////////
#define WIN32_LEAN_AND_MEAN // just say no to MFC

#include <windows.h> // include all the windows headers
#include <windowsx.h> // include useful macros
#include <mmsystem.h> // very important and include WINMM.LIB too!
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

// DEFINES ////////////////////////////////////////////////

// defines for windows
#define WINDOW_CLASS_NAME "WINCLASS1"

#define WINDOW_WIDTH 400
#define WINDOW_HEIGHT 300

// MACROS /////////////////////////////////////////////////

#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
#define KEYUP(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)

// GLOBALS ////////////////////////////////////////////////
HWND main_wind