Click here to Skip to main content
15,917,320 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionIs it possiible to set font for not integer size ? Pin
vgrigor25-Mar-04 1:07
vgrigor25-Mar-04 1:07 
GeneralLoading resouce from .dll Pin
nareshn225-Mar-04 0:38
nareshn225-Mar-04 0:38 
GeneralRequest for advice on design of complex dialog Pin
iknowindigo25-Mar-04 0:01
iknowindigo25-Mar-04 0:01 
GeneralIdentifying controls in CDialog Pin
JonWayne24-Mar-04 23:44
JonWayne24-Mar-04 23:44 
GeneralRe: Identifying controls in CDialog Pin
JonWayne24-Mar-04 23:59
JonWayne24-Mar-04 23:59 
GeneralRe: Identifying controls in CDialog Pin
toxcct25-Mar-04 1:44
toxcct25-Mar-04 1:44 
GeneralRe: Identifying controls in CDialog Pin
David Crow25-Mar-04 2:33
David Crow25-Mar-04 2:33 
GeneralLoad Resource's Bitmap To HBITMAP Pin
akirachen24-Mar-04 23:42
akirachen24-Mar-04 23:42 
Load Resource's Bitmap To HBITMAP

I want to replace frame.LoadBmp("TextFrame.bmp") by frame.LoadBmp(IDB_BITMAP).
On other words,Original loaded picture by function "LoadImage", I want to load picture by Resouce's Bitmap.

HBITMAP hBitmap;//is member variable of CDibSection
hBitmap=uknownfunction(IDB_BITMAP)

How do I rewrite CDibSection::LoadBmp to Load Resource's Bitmap To HBITMAP?

PS:IDB_BITMAP is a Bitmap of Resoucre.



CDibSection frame;

////////////////
if (frame.LoadBmp("TextFrame.bmp")) {
HRGN h = frame.CreateRgn();
if (h)
SetWindowRgn(h, TRUE);
}
////////////////

// Loading BMP file
//
BOOL CDibSection::LoadBmp(const char *path)
{
Destroy();

hBitmap = (HBITMAP)::LoadImage(::GetModuleHandle(0), path, IMAGE_BITMAP, 0, 0,
LR_CREATEDIBSECTION | LR_LOADFROMFILE);
if (!hBitmap)
return FALSE;

DIBSECTION dib;
if (::GetObject(hBitmap, sizeof(DIBSECTION), &dib) != sizeof(DIBSECTION)) {
::DeleteObject(hBitmap);
hBitmap = 0;
return FALSE;
}
Header.Info = dib.dsBmih;
for (int i=0; i<3; i++)
Header.BitField[i] = dib.dsBitfields[i];

bytes_per_pixel = PixelBytes(dib.dsBmih.biBitCount);
bytes_per_line = ScanBytes(dib.dsBmih.biWidth, dib.dsBmih.biBitCount);
Bits = dib.dsBm.bmBits;

return TRUE;
}
GeneralCHtmlView inside SDI App. - Painting the Mainframe Pin
AssemblySoft24-Mar-04 22:28
AssemblySoft24-Mar-04 22:28 
GeneralPaste CF_METAFILEPICT in a rtf dialog box app Pin
Filomela24-Mar-04 21:57
Filomela24-Mar-04 21:57 
GeneralConversion... Pin
Anonymous24-Mar-04 21:51
Anonymous24-Mar-04 21:51 
GeneralRe: Conversion... Pin
Steve S24-Mar-04 22:05
Steve S24-Mar-04 22:05 
GeneralRe: Conversion... Pin
wb24-Mar-04 22:17
wb24-Mar-04 22:17 
GeneralRe: Conversion... Pin
Anonymous25-Mar-04 0:57
Anonymous25-Mar-04 0:57 
GeneralRe: Conversion... Pin
ravjak25-Mar-04 6:47
ravjak25-Mar-04 6:47 
GeneralProblem with COleDateTime Pin
PravinSingh24-Mar-04 21:40
PravinSingh24-Mar-04 21:40 
GeneralRe: Problem with COleDateTime Pin
Cedric Moonen24-Mar-04 21:48
Cedric Moonen24-Mar-04 21:48 
GeneralRe: Problem with COleDateTime Pin
David Crow25-Mar-04 2:41
David Crow25-Mar-04 2:41 
GeneralEnums Pin
monrobot1324-Mar-04 21:22
monrobot1324-Mar-04 21:22 
GeneralRe: Enums Pin
Anonymous24-Mar-04 21:32
Anonymous24-Mar-04 21:32 
GeneralRe: Enums Pin
Maxwell Chen24-Mar-04 21:52
Maxwell Chen24-Mar-04 21:52 
GeneralRe: Enums Pin
David Crow25-Mar-04 2:48
David Crow25-Mar-04 2:48 
GeneralRe: Enums Pin
monrobot1325-Mar-04 18:33
monrobot1325-Mar-04 18:33 
Generalimproving a hack Pin
axid3j1al24-Mar-04 20:25
axid3j1al24-Mar-04 20:25 
QuestionHow to popup the application-menu ? Pin
ohadp24-Mar-04 20:16
ohadp24-Mar-04 20:16 

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.