• 年终了,没有一分钱的年终奖金,这年过得一年不如一年啦!


    2010年2月10日

    代码
     1 int nRange = m_nRangeMax - m_nRangeMin;
     2     CRect rcClient;
     3 
     4     if( nRange > 0 && m_hBkPic )
     5     {
     6         int nOldBkMode = GetBkMode( lpDrawItemStruct->hDC );
     7         COLORREF cOldColor = GetTextColor( lpDrawItemStruct->hDC );
     8 
     9         GetWindowRect( rcClient );
    10         GetParent( )->ScreenToClient( rcClient );
    11 
    12         HDC hBkDC = CreateCompatibleDC( lpDrawItemStruct->hDC );
    13         HGDIOBJ hOldBmp = SelectObject( hBkDC, m_hBkPic );
    14 
    15         // 擦除
    16         BitBlt( lpDrawItemStruct->hDC, 00, rcClient.Width( ), 
    17             rcClient.Height( ), hBkDC, rcClient.left, rcClient.top, SRCCOPY );
    18 
    19         int nPosX = rcClient.Width( ) * (float)m_nCurPos / (float)nRange;
    20         if!m_hProgressFr )
    21         {
    22             // 自己填充颜色
    23             CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
    24             CBrush br;
    25             br.CreateHatchBrush( HS_CROSS, m_crProgressColor);
    26             pDC->FillRect( CRect( 00, nPosX, rcClient.Height( ) ), &br );
    27         }
    28 
    29         GetClientRect( rcClient );
    30 
    31         CString strName;
    32         strName.Format( "%d%%", (int)((float)m_nCurPos / (float)nRange * 100) );
    33         SetBkMode( lpDrawItemStruct->hDC, TRANSPARENT );
    34         SetROP2( lpDrawItemStruct->hDC, R2_BLACK );
    35 
    36         if( m_hProgressFr )
    37         {
    38             SelectObject( hBkDC, m_hProgressFr );
    39             //            BitBlt( lpDrawItemStruct->hDC, 0, 0, nPosX, rcClient.Height( ), hBkDC, 0, 0, SRCERASE ); // 
    40             BitBlt( lpDrawItemStruct->hDC, 00, nPosX, rcClient.Height( ), hBkDC, 00, SRCCOPY ); // 
    41         }
    42 
    43         OffsetRect( rcClient, 11 );
    44         SetTextColor( lpDrawItemStruct->hDC, RGB( 000 ) );
    45         DrawText( lpDrawItemStruct->hDC, strName, strName.GetLength( ), rcClient, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
    46         OffsetRect( rcClient, -1-1 );
    47         SetTextColor( lpDrawItemStruct->hDC, RGB( 2002000 ) );
    48         DrawText( lpDrawItemStruct->hDC, strName, strName.GetLength( ), rcClient, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
    49 
    50 
    51         SetBkMode( lpDrawItemStruct->hDC, nOldBkMode );
    52         SetTextColor( lpDrawItemStruct->hDC, cOldColor );
    53 
    54         SelectObject( hBkDC, hOldBmp );
    55         DeleteDC( hBkDC );
    56     }
  • 相关阅读:
    Hibernate映射之数组属性, 集合属性(list、set和map)
    org.hibernate.type.SerializationException: could not deserialize 反序列化失败
    linux下同一个tomcat部署多个项目
    Nexus私服 Maven
    maven 父子项目 聚合与继承 生命周期 打包插件 依赖打包 jar pom war
    IDEA中创建Web聚合项目(Maven多模块项目)
    为什么要在linux命令前加上 ./ 什么时候才需要在命令前加上./
    web.xml 介绍 and pom.xml 介绍
    有趣的linux命令
    SpringMVC 中常见注释
  • 原文地址:https://www.cnblogs.com/cyrus/p/cyrus.html
Copyright © 2020-2023  润新知