DirectWrite处理WM_SIZE消息

简介:

对于DirectWrite程序,在窗口大小改变时,也要同步更新render target的尺寸,否则的话,所绘文本可能超出窗口之外。可以定义一个OnResize函数来更新render target的尺寸,然后再WM_SIZE中调用这个函数。

复制代码
// When window size changed, we need to resize the render target as well
VOID OnResize(UINT width, UINT height)
{
    if(g_pRenderTarget)
    {
        D2D1_SIZE_U size = D2D1::SizeU(width, height);
        g_pRenderTarget->Resize(size);
    }
}
复制代码

调用

复制代码
case WM_SIZE:
    {
        UINT width = LOWORD(lParam);
        UINT height = HIWORD(lParam);
        OnResize(width, height);
        break;
    }
复制代码

==

本文转自zdd博客园博客,原文链接:http://www.cnblogs.com/graphics/archive/2012/09/15/2686985.html,如需转载请自行联系原作者

相关文章
|
JSON 监控 测试技术
Rabbmit MQ 清空所有Queue及其message
在测试区,经常因为测试导致测试区很多队列里面堆积很多消息。这一方面对测试区MQ的性能造成问题,dashboard这个插件经常卡主。此外消息过多也不方便debug。
1354 0
|
消息中间件 数据库
Rabbmit channel.QueueDeclare参数初识
接触MQ易经有一段时间了,对QueueDeclare一直没有一个全面的认识。
223 0
SAP WM&SD集成之Copy WM Quantity – Copy WM qty as delivery qty into delivery and PGI
SAP WM&SD集成之Copy WM Quantity – Copy WM qty as delivery qty into delivery and PGI
SAP WM&SD集成之Copy WM Quantity – Copy WM qty as delivery qty into delivery and PGI
SAP WM&SD集成之Copy WM Quantity – Copy WM qty as delivery qty into delivery
SAP WM&SD集成之Copy WM Quantity – Copy WM qty as delivery qty into delivery
SAP WM&SD集成之Copy WM Quantity – Copy WM qty as delivery qty into delivery
SAP WM&SD集成之Copy WM Quantity – Not Copy WM qty as delivery qty into delivery But PGI
SAP WM&SD集成之Copy WM Quantity – Not Copy WM qty as delivery qty into delivery But PGI
SAP WM&SD集成之Copy WM Quantity – Not Copy WM qty as delivery qty into delivery But PGI
SAP WM 能否使用LT12去确认一个需要2-step法确认的TO单?
SAP WM 能否使用LT12去确认一个需要2-step法确认的TO单?
SAP WM 能否使用LT12去确认一个需要2-step法确认的TO单?