(转载)用DDraw画YV12图像

用DirectDraw显示YV12图像(Draw YV12)

// yv12.cpp : 

#define WIN32_LEAN_AND_MEAN  // 从 Windows 头中排除极少使用的资料
#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>

#include “ddraw.h”
#pragma comment(lib,”ddraw.lib”)

// 此代码模块中包含的函数的前向声明:
LRESULT CALLBACK  WndProc(HWND, UINT, WPARAM, LPARAM); // 窗口消息处理函数
BOOL     DrawYV12(HWND hWnd);    // Draw YV12 图像

// 应用入口
int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
 MSG msg;
 WNDCLASSEX wcex;
 TCHAR szWindowClass[] = “Draw YV12

By Lu Jun

80后男,就职于软件行业。习于F*** GFW。人生48%时间陪同电子设备和互联网,美剧迷,高清视频狂热者,游戏菜鸟,长期谷粉,临时果粉,略知摄影。

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.