DeleteDC 该函数删除指定的设备上下文环境(DC). 原型: BOOL DeleteDC(HDC hdc): 参数: hdc:设备上下文环境的句柄. 返回值: 成功,返回非零值:失败,返回零.调用GetLastError获取扩展错误信息. 说明: 如果一个设备上下文环境的句柄是通过调用GetDC函数得到的,那么应用程序不能删除该设备上下文环境,它应该调用ReleaseDC函数来释放该设备上下文环境. ReleaseDC 函数释放设备上下文环境(DC)供其他应用程序使用.函数的效果与设备上下…
14.4.10 非矩形的位图图像 (1)“掩码”位图——单色位图,要显示的像素对应的掩码置1,不显示置0(2)光栅操作(点这里,见此文分析) (3)MaskBlt函数 ①MaskBlt(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc,hbmMask, xMask, yMask, dwRop): ②前景和背景:在由hbmMask指定的掩码中,数值1表示在那个位置应使用dwRop指定的前景光栅操作码.数值0表示应使用dwR…
14.4.7 在位图上绘图 (1)在内存设备环境中绘图(与真实DC不同的是,内存DC的显示表面是个位图) (2)GetTextExtentPoint32函数:用于确定文本字符串的像素大小.(此大小就是与视频显示兼容的位图的尺寸). 参数 说明 hdc 设备环境句柄 lpString 文本字符串,如szText cbString 文本字符串中字符的个数.如lstrlen(szText) lpSize 指向一个结构体,用来存放结果 (3)当显示器的颜色深度和大小改变时,windows会自动改变内存设…
>_<:this is the first using mapping. >_<:There will be introducing how to do: First load bitmap picture return handle give hbmp, as following: hbmp=(HBITMAP)LoadImage(NULL,"bg.bmp",IMAGE_BITMAP,600,450,LR_LOADFROMFILE); there "b…
>_<:Previous part we talk about how to map a transparent picture, and this time we will solve the problem how to change a picture's transparency. >_<:Here my method is reading the picture's information and change its RGB or add another picture…
>_<:Only give you the code,try to understand it! >_<:picture resource #include <windows.h> // C 运行时头文件 #include <stdlib.h> #include <cstdio> #include <malloc.h> #include <memory.h> #include <tchar.h> #includ…
>_<:AI introduction. >_<:According the plane position (nowX,nowY) relative to birds' position (p[i].x,p[i].y)  automaticly change birds' position. //贴上小鸟 SelectObject(bufdc,bird); ;i<;i++){ !=){ ) p[i].y-=; else p[i].y+=; ) p[i].x-=; else p…
>_<:Here introduce a simple game: >_<:resource >_<:only can push a box and finally arrive the gate. #include <windows.h> // C 运行时头文件 #include <stdlib.h> #include <cstdio> #include <malloc.h> #include <memory.h&…
>_<:Learning its AI logic. >_<:resource >_<:code: #include <windows.h> // C 运行时头文件 #include <stdlib.h> #include <cstdio> #include <malloc.h> #include <memory.h> #include <tchar.h> #include <time.h&g…
>_<:Learning the physical engine >_<:resource >_<:code #include <windows.h> // C 运行时头文件 #include <stdlib.h> #include <cstdio> #include <malloc.h> #include <memory.h> #include <tchar.h> #include <tim…