如题,谢谢
解决方案 »
- 使用CXListCtrl 静态链接时,出现 error LNK2001: 无法解析的外部符号
- 一个关于控件位置分配的问题
- VC ADO SQL2000 SQL语句语法问题
- 急!!!关于SOCKET的一个问题.
- 请教一个算法: 怎么样把真彩色空间分成25份,要求这25个值尽可能地均匀分布.
- 急!!如何消除Dialog中控件的闪烁?
- 急!大家一定要帮忙啊!怎样设置对话框指针!!!!
- 学习中,网上拿过来的代码,怎么会出现未出现的异常,高人给分析下原因
- m_pDib = NULL //???
- 请问哪里有关于图形比较方面的资料?网址?
- 在用DirectShow做摄像机的程序,遇到一些问题...请高手帮忙看看。
- 为什么CMyButton不能显示
#include <windows.h>
#include <gdiplus.h>
using namespace Gdiplus;VOID OnPaint(HDC hdc)
{
Graphics graphics(hdc);
Pen pen(Color(255, 0, 0, 255));
graphics.DrawLine(&pen, 0, 0, 200, 100);
}LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, PSTR, INT iCmdShow)
{
HWND hWnd;
MSG msg;
WNDCLASS wndClass;
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
// Initialize GDI+.
GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
wndClass.style = CS_HREDRAW | CS_VREDRAW;
wndClass.lpfnWndProc = WndProc;
wndClass.cbClsExtra = 0;
wndClass.cbWndExtra = 0;
wndClass.hInstance = hInstance;
wndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
wndClass.lpszMenuName = NULL;
wndClass.lpszClassName = TEXT("GettingStarted");
RegisterClass(&wndClass);
hWnd = CreateWindow(
TEXT("GettingStarted"), // window class name
TEXT("Getting Started"), // window caption
WS_OVERLAPPEDWINDOW, // window style
CW_USEDEFAULT, // initial x position
CW_USEDEFAULT, // initial y position
CW_USEDEFAULT, // initial x size
CW_USEDEFAULT, // initial y size
NULL, // parent window handle
NULL, // window menu handle
hInstance, // program instance handle
NULL); // creation parameters
ShowWindow(hWnd, iCmdShow);
UpdateWindow(hWnd);
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
GdiplusShutdown(gdiplusToken);
return msg.wParam;
} // WinMainLRESULT CALLBACK WndProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PAINTSTRUCT ps;
switch(message)
{
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
OnPaint(hdc);
EndPaint(hWnd, &ps);
return 0;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
} // WndProc然后下载 platform SDK,Runtime GDI+,设置include lib路径,link gdiplus.lib
最好有具体的实例?
还有红眼校正,高斯模糊,色平衡,锐化,着色等功能。但是还没有提供下载
至于旧版的,自己看msdn吧,所有例子代码都有的http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/GDIPlus/GDIPlusReference/Classes/
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=BFC0B436-9015-43E2-81A3-54938B6F4614