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

C / C++ / MFC

 
AnswerRe: Windows Startup Pin
Fired Fish15-Oct-05 1:29
Fired Fish15-Oct-05 1:29 
AnswerRe: Windows Startup Pin
ThatsAlok15-Oct-05 4:48
ThatsAlok15-Oct-05 4:48 
QuestionWhere can I input parameter in VC7 when I debugger? Pin
chenxiujie15-Oct-05 0:56
chenxiujie15-Oct-05 0:56 
AnswerRe: Where can I input parameter in VC7 when I debugger? Pin
Member 168985515-Oct-05 1:22
Member 168985515-Oct-05 1:22 
AnswerRe: Where can I input parameter in VC7 when I debugger? Pin
S. Senthil Kumar15-Oct-05 1:49
S. Senthil Kumar15-Oct-05 1:49 
GeneralRe: Where can I input parameter in VC7 when I debugger? Pin
chenxiujie15-Oct-05 2:07
chenxiujie15-Oct-05 2:07 
AnswerRe: Where can I input parameter in VC7 when I debugger? Pin
Fired Fish15-Oct-05 2:19
Fired Fish15-Oct-05 2:19 
Questionhow to create a DIB bitmap with a array Pin
daojinliu15-Oct-05 0:53
daojinliu15-Oct-05 0:53 
int the function OnDraw(),I want to create a DIB bitmap using the array pData,but I am not successful,Please help me.
//the array containing color information
unsigned char* pData=new unsigned char[768*576];
int y=0, x=0;
for(;y<576;y++)
for(;x<768;x++)
{
pData[x*3+y*768*3]=0;
pData[x*3+1+y*768*3]=0;
pData[x*3+2+y*768*3]=255;
}
//information header

BITMAPINFOHEADER FrameBmi;
FrameBmi.biSize=sizeof(BITMAPINFOHEADER);
FrameBmi.biPlanes=1;
FrameBmi.biCompression=BI_RGB;
FrameBmi.biClrImportant=0;
FrameBmi.biSizeImage=768*576*3;
FrameBmi.biClrUsed=0;
FrameBmi.biBitCount=24;
FrameBmi.biWidth=768;
FrameBmi.biHeight=576;
FrameBmi.biXPelsPerMeter = 0;
FrameBmi.biYPelsPerMeter =0;
//file header
BITMAPFILEHEADER pf;
pf.bfType=0x4d42; //"BM"
pf.bfSize=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)+sizeof(char[768*576]);
pf.bfOffBits=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER);
pf.bfReserved1=0;
pf.bfReserved2=0;

//BITMAPINFOHEADER
LPBITMAPINFO lpbmi=(LPBITMAPINFO)GlobalAlloc(GMEM_FIXED,sizeof(BITMAPINFOHEADER));
ASSERT(lpbmi);
lpbmi->bmiHeader.biSize=FrameBmi.biSize;
lpbmi->bmiHeader.biPlanes=FrameBmi.biPlanes;
lpbmi->bmiHeader.biCompression=FrameBmi.biCompression;
lpbmi->bmiHeader.biClrImportant=FrameBmi.biClrImportant;
lpbmi->bmiHeader.biSizeImage=FrameBmi.biSizeImage;
lpbmi->bmiHeader.biClrUsed=FrameBmi.biClrUsed;
lpbmi->bmiHeader.biBitCount=FrameBmi.biBitCount;
lpbmi->bmiHeader.biWidth=FrameBmi.biWidth;
lpbmi->bmiHeader.biHeight=FrameBmi.biHeight;
lpbmi->bmiHeader.biXPelsPerMeter=FrameBmi.biXPelsPerMeter;
lpbmi->bmiHeader.biYPelsPerMeter=FrameBmi.biYPelsPerMeter;
lpbmi->bmiColors=NULL;

//创建DIB位图
CBitmap *OldBitmap;
HBITMAP bmp =::CreateDIBitmap((HDC)pDC,&FrameBmi,CBM_INIT,pData,lpbmi, DIB_RGB_COLORS);
ASSERT(bmp);
//
CBitmap bitmap;
bitmap.Attach(bmp);
CDC dcComp;
dcComp.CreateCompatibleDC(pDC);
OldBitmap=dcComp.SelectObject(&bitmap);
BITMAP bm;
bitmap.GetObject(sizeof(BITMAP),&bm);

// draw bitmap
pDC->BitBlt(0,0,768,576,&dcComp,0,0,SRCCOPY);
dcComp.SelectObject(OldBitmap);
delete [] pData;
GlobalFree(lpbmi);


help me!
Questionprotected, public and private Pin
karmendra_js15-Oct-05 0:44
karmendra_js15-Oct-05 0:44 
AnswerRe: protected, public and private Pin
S. Senthil Kumar15-Oct-05 0:51
S. Senthil Kumar15-Oct-05 0:51 
AnswerRe: protected, public and private Pin
Gary R. Wheeler15-Oct-05 2:50
Gary R. Wheeler15-Oct-05 2:50 
AnswerRe: protected, public and private Pin
ThatsAlok15-Oct-05 4:53
ThatsAlok15-Oct-05 4:53 
QuestionInitial OnPaint Pin
Trollslayer15-Oct-05 0:43
mentorTrollslayer15-Oct-05 0:43 
AnswerRe: Initial OnPaint Pin
Prakash Nadar15-Oct-05 0:53
Prakash Nadar15-Oct-05 0:53 
GeneralRe: Initial OnPaint Pin
Trollslayer15-Oct-05 0:59
mentorTrollslayer15-Oct-05 0:59 
GeneralRe: Initial OnPaint Pin
Prakash Nadar15-Oct-05 6:24
Prakash Nadar15-Oct-05 6:24 
AnswerRe: Initial OnPaint Pin
S. Senthil Kumar15-Oct-05 1:02
S. Senthil Kumar15-Oct-05 1:02 
GeneralRe: Initial OnPaint Pin
Trollslayer15-Oct-05 1:16
mentorTrollslayer15-Oct-05 1:16 
AnswerRe: Initial OnPaint Pin
Tim Smith15-Oct-05 4:51
Tim Smith15-Oct-05 4:51 
GeneralRe: Initial OnPaint Pin
Trollslayer15-Oct-05 4:58
mentorTrollslayer15-Oct-05 4:58 
GeneralRe: Initial OnPaint Pin
Prakash Nadar15-Oct-05 6:22
Prakash Nadar15-Oct-05 6:22 
AnswerRe: Initial OnPaint Pin
John R. Shaw16-Oct-05 16:48
John R. Shaw16-Oct-05 16:48 
Questionabstract base class Pin
toxcct15-Oct-05 0:36
toxcct15-Oct-05 0:36 
AnswerRe: abstract base class Pin
S. Senthil Kumar15-Oct-05 0:52
S. Senthil Kumar15-Oct-05 0:52 
GeneralRe: abstract base class Pin
toxcct15-Oct-05 1:23
toxcct15-Oct-05 1:23 

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.