Click here to Skip to main content
15,920,896 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Regexp Pin
Rage4-Jul-03 2:40
professionalRage4-Jul-03 2:40 
GeneralRe: Regexp Pin
Ryan Binns4-Jul-03 2:45
Ryan Binns4-Jul-03 2:45 
GeneralSetting up a slider control. Pin
blackmesa3-Jul-03 20:50
blackmesa3-Jul-03 20:50 
Questionhow to get the current window system language name? Pin
benben3-Jul-03 17:36
benben3-Jul-03 17:36 
AnswerRe: how to get the current window system language name? Pin
Ryan Binns3-Jul-03 20:27
Ryan Binns3-Jul-03 20:27 
GeneralThanks Pin
benben4-Jul-03 21:37
benben4-Jul-03 21:37 
GeneralRe: Thanks Pin
Ryan Binns4-Jul-03 21:41
Ryan Binns4-Jul-03 21:41 
GeneralImage is not showing in 16 million colors Pin
spicy_kid20003-Jul-03 17:34
spicy_kid20003-Jul-03 17:34 
Hi all, please help me.
I am trying to load a bitmap using LoadImage . I have attach the code . Please create a bitmap of size 32*23 and save it to 256 colors.My Display pallette setting is in 16 million colors.

This is working fine in 256 color setting.

32*32 is the image width and image height.

OnDrawFunction()
{
typedef unsigned short UINT16;

UINT16 *MyDisplayBuffer = (UINT16*)GlobalAlloc(GPTR,32*32*2);

m_hBitmap = (HBITMAP)LoadImage(NULL,"C:\\Bitmap1.bmp", IMAGE_BITMAP, 0, 0,LR_LOADFROMFILE | LR_CREATEDIBSECTION | LR_DEFAULTSIZE);

CBitmap bmp;

bmp.Attach(m_hBitmap);

BYTE* DisplayBuffer=(BYTE*)GlobalAlloc(GPTR,32*32);

int Update = 0;

int color =0;

CDC memdc;

memdc.CreateCompatibleDC(pDC);

SelectObject( memdc,m_hBitmap);

bmp.GetBitmapBits(32*32,DisplayBuffer);




for(int y =0; y < 32; y++)
{
for(int x =0 ; x< 32; x++)
{
int index = x + y *32;

color= DisplayBuffer[Update];

MyDisplayBuffer[index] =color

Update++;
}
}


CDC dcDisplayMemory;

CBitmap bmp1;

dcDisplayMemory.CreateCompatibleDC(pDC);

bmp1.CreateCompatibleBitmap(pDC,32,32);

dcDisplayMemory.SelectObject(&bmp1);

bmp1.SetBitmapBits(32*32 *2,MyDisplayBuffer);

pDC->BitBlt(10,20,32,32,&dcDisplayMemory,0,0,SRCCOPY);
}

Thanks in Advance
GeneralRe: Image is not showing in 16 million colors Pin
Ryan Binns3-Jul-03 19:13
Ryan Binns3-Jul-03 19:13 
GeneralRe: Image is not showing in 16 million colors Pin
spicy_kid20003-Jul-03 19:25
spicy_kid20003-Jul-03 19:25 
QuestionMax array size? Pin
leppie3-Jul-03 17:18
leppie3-Jul-03 17:18 
AnswerRe: Max array size? Pin
John M. Drescher3-Jul-03 17:24
John M. Drescher3-Jul-03 17:24 
GeneralRe: Max array size? Pin
leppie3-Jul-03 17:37
leppie3-Jul-03 17:37 
GeneralRe: Max array size? Pin
John M. Drescher3-Jul-03 17:47
John M. Drescher3-Jul-03 17:47 
GeneralRe: Max array size? Pin
leppie3-Jul-03 18:03
leppie3-Jul-03 18:03 
GeneralRe: Max array size? Pin
John M. Drescher3-Jul-03 18:21
John M. Drescher3-Jul-03 18:21 
GeneralRe: Max array size? Pin
leppie3-Jul-03 18:27
leppie3-Jul-03 18:27 
AnswerRe: Max array size? Pin
Ryan Binns3-Jul-03 19:05
Ryan Binns3-Jul-03 19:05 
GeneralCListCtrl - lost sel on postmsg DBLCLK Pin
kyndestad3-Jul-03 17:09
kyndestad3-Jul-03 17:09 
GeneralRe: CListCtrl - lost sel on postmsg DBLCLK Pin
Ryan Binns3-Jul-03 17:15
Ryan Binns3-Jul-03 17:15 
GeneralRe: CListCtrl - lost sel on postmsg DBLCLK Pin
kyndestad7-Jul-03 5:11
kyndestad7-Jul-03 5:11 
GeneralRe: CListCtrl - lost sel on postmsg DBLCLK Pin
Ryan Binns7-Jul-03 5:16
Ryan Binns7-Jul-03 5:16 
GeneralOffice Add-in Pin
Andrew Walker3-Jul-03 16:46
Andrew Walker3-Jul-03 16:46 
GeneralRe: Office Add-in Pin
Andrew Walker3-Jul-03 20:24
Andrew Walker3-Jul-03 20:24 
GeneralAdo Pin
Anthony98873-Jul-03 16:36
Anthony98873-Jul-03 16:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.