Ignore:
Timestamp:
Jan 31, 2011, 12:18:33 AM (13 years ago)
Author:
イグトランス (egtra)
Message:

LoadBitmapの代替関数を実装

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/egtra/ab5.0/abdev/abdev-impl/Resource/Load.cpp

    r794 r795  
    55#include <boost/range/adaptor/transformed.hpp>
    66#include <boost/numeric/conversion/cast.hpp>
     7#include <atlbase.h>
     8#pragma warning(push)
     9#pragma warning(disable: 6387)
     10#include <atlapp.h>
     11#include <atlgdi.h>
     12#pragma warning(pop)
    713#include <Resource/Load.h>
    814
     
    182188}
    183189
     190HBITMAP LoadBitmapAlt(HINSTANCE hinst, USHORT id)
     191{
     192    WTL::CDC dc = ::GetDC(nullptr);
     193    auto pbi = static_cast<BITMAPINFO const*>(GetResource(hinst, id, RT_BITMAP));
     194    return CreateDIBitmap(dc, &pbi->bmiHeader, CBM_INIT, reinterpret_cast<BYTE const*>(pbi) + pbi->bmiHeader.biSize, pbi, DIB_RGB_COLORS);
     195}
     196
    184197}}
Note: See TracChangeset for help on using the changeset viewer.