Changeset 795 in dev


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

LoadBitmapの代替関数を実装

Location:
branches/egtra/ab5.0/abdev
Files:
3 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}}
  • branches/egtra/ab5.0/abdev/abdev-impl/Resource/Load.h

    r794 r795  
    2121HWND CreateDialogAlt(HINSTANCE hinst, USHORT id, HWND hwndParent, DLGPROC dialogFunc, LPARAM initParam = 0);
    2222
     23HBITMAP LoadBitmapAlt(HINSTANCE hinst, USHORT id);
     24
    2325struct IconDeleter
    2426{
  • branches/egtra/ab5.0/abdev/abdev/ParameterHint.cpp

    r713 r795  
    10961096            HBITMAP hBmp,hOldBmp;
    10971097            HDC memdc;
    1098             hBmp=(HBITMAP)LoadImage(hResInst,MAKEINTRESOURCE(IDB_PARAMHINT_QUESTION),IMAGE_BITMAP,0,0,LR_DEFAULTSIZE);
     1098            hBmp = ActiveBasic::Resource::LoadBitmapAlt(hResInst, IDB_PARAMHINT_QUESTION);
    10991099            memdc=CreateCompatibleDC(hdc);
    11001100            hOldBmp=(HBITMAP)SelectObject(memdc,hBmp);
     
    11191119                hdc=GetDC(hwnd);
    11201120
    1121                 hBmp=(HBITMAP)LoadImage(hResInst,MAKEINTRESOURCE(IDB_PARAMHINT_QUESTION2),IMAGE_BITMAP,0,0,LR_DEFAULTSIZE);
     1121                hBmp = ActiveBasic::Resource::LoadBitmapAlt(hResInst,IDB_PARAMHINT_QUESTION2);
    11221122                memdc=CreateCompatibleDC(hdc);
    11231123                hOldBmp=(HBITMAP)SelectObject(memdc,hBmp);
     
    11371137                hdc=GetDC(hwnd);
    11381138
    1139                 hBmp=(HBITMAP)LoadImage(hResInst,MAKEINTRESOURCE(IDB_PARAMHINT_QUESTION),IMAGE_BITMAP,0,0,LR_DEFAULTSIZE);
     1139                hBmp = ActiveBasic::Resource::LoadBitmapAlt(hResInst, IDB_PARAMHINT_QUESTION);
    11401140                memdc=CreateCompatibleDC(hdc);
    11411141                hOldBmp=(HBITMAP)SelectObject(memdc,hBmp);
Note: See TracChangeset for help on using the changeset viewer.