Click here to Skip to main content
15,891,409 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how do I save a bitmap to hard-disk? Pin
valikac28-Jul-06 15:22
valikac28-Jul-06 15:22 
AnswerRe: how do I save a bitmap to hard-disk? Pin
Chris Losinger28-Jul-06 19:10
professionalChris Losinger28-Jul-06 19:10 
AnswerRe: how do I save a bitmap to hard-disk? Pin
Hamid_RT28-Jul-06 21:45
Hamid_RT28-Jul-06 21:45 
QuestionHow to create a directory? [modified] Pin
10011000100101101000028-Jul-06 11:12
10011000100101101000028-Jul-06 11:12 
AnswerRe: How to create a directory? Pin
Gary R. Wheeler28-Jul-06 15:32
Gary R. Wheeler28-Jul-06 15:32 
QuestionGet a pointer to a property page? Pin
DanYELL28-Jul-06 10:25
DanYELL28-Jul-06 10:25 
AnswerRe: Get a pointer to a property page? Pin
Zac Howland28-Jul-06 10:35
Zac Howland28-Jul-06 10:35 
QuestionHow to Extract Single Image (Frame) from a CImageList ?? Pin
MacGadger28-Jul-06 9:23
MacGadger28-Jul-06 9:23 
Hello , can anybody help me.. i want to Extract a Single Frame from a CImageList and want to show the Extracted Image to a CStatic Control. im using this method to Load and show the Bitmap to CStatic Control : --->

//////////////////////////////////////////////////////
//////////////////////////////////////////////
/////////////////////////////////////////

BOOL CXXXDlg::OnInitDialog()
{
..................
..........

// CImageList to load bitmap from Outside
CImageList m_imgList;

HIMAGELIST hImageList = ::ImageList_LoadImage(
AfxGetInstanceHandle (),
_T("C:\\xxxx.bmp"),
64, 32,
RGB(255,0,255),
IMAGE_BITMAP, LR_LOADFROMFILE);

/*Copies the Single (Image)Frame from the Image List to CBitmap */
CBitmap *hBmp = new CBitmap;
and
CBitmap hBmp;

if(NULL != hImageList)
{
BOOL bRet = m_imgList.Attach(hImageList);

GetImageFromList(&m_imgList , 0 , &hBmp );
and
GetImageFromList(&m_imgList , 0 , hBmp );

//////////////////////////////////////////////
// This is the CStatic Control on the Dialog //

m_bBit.SetBitmap((HBITMAP)&hBmp);
and
m_bBit.SetBitmap((HBITMAP)hBmp);

/////////////////////////////////////////
...........
.................
}

void CXXXDlg::GetImageFromList(CImageList *lstImages, int nImage,
CBitmap *destBitmap)
{

//First we want to create a temporary image list we can manipulate
CImageList tmpList;
tmpList.Create(lstImages);

//Then swap the requested image to the first spot in the list
tmpList.Copy( 0, nImage, ILCF_SWAP );

//Now we need to get som information about the image
IMAGEINFO lastImage;
tmpList.GetImageInfo(0,&lastImage);

//Heres where it gets fun
//Create a Compatible Device Context using
//the valid DC of your calling window
CDC dcMem; dcMem.CreateCompatibleDC (GetWindowDC());

//This rect simply stored the size of the image we need
CRect rect (lastImage.rcImage);

//Using the bitmap passed in, Create a bitmap
//compatible with the window DC
//We also know that the bitmap needs to be a certain size.
destBitmap->CreateCompatibleBitmap (this->GetWindowDC(),
rect.Width (), rect.Height ());

//Select the new destination bitmap into the DC we created above
CBitmap* pBmpOld = dcMem.SelectObject (destBitmap);

//This call apparently "draws" the bitmap from the list,
//onto the new destination bitmap
tmpList.DrawIndirect (&dcMem, 0, CPoint (0, 0),
CSize (rect.Width (), rect.Height ()), CPoint (0, 0));


//cleanup by reselecting the old bitmap object into the DC
dcMem.SelectObject (pBmpOld);

}

//////////////////////////////////////////////////////
///////////////////////////////////////////////
//////////////////////////////////////////

The Application Compiled n Build n Runs Succesfully ! , but it does not shows the Extracted Bitmap Frame Frown | :(

can anyone please tell me how to do tht... ???? Frown | :( pleasee
AnswerRe: How to Extract Single Image (Frame) from a CImageList ?? Pin
Hamid_RT28-Jul-06 22:41
Hamid_RT28-Jul-06 22:41 
QuestionSetup projects can't find MsiLoadr.Bin file Pin
Roj28-Jul-06 9:15
Roj28-Jul-06 9:15 
AnswerRe: Setup projects can't find MsiLoadr.Bin file Pin
Gary R. Wheeler28-Jul-06 15:55
Gary R. Wheeler28-Jul-06 15:55 
Questionplugin development for pocket WMP Pin
Mohammad A Gdeisat28-Jul-06 7:47
Mohammad A Gdeisat28-Jul-06 7:47 
QuestionMemory allocation problem?? Pin
pavanbabut28-Jul-06 7:30
pavanbabut28-Jul-06 7:30 
AnswerRe: Memory allocation problem?? Pin
Zac Howland28-Jul-06 7:51
Zac Howland28-Jul-06 7:51 
GeneralRe: Memory allocation problem?? Pin
pavanbabut28-Jul-06 8:51
pavanbabut28-Jul-06 8:51 
GeneralRe: Memory allocation problem?? Pin
Zac Howland28-Jul-06 9:16
Zac Howland28-Jul-06 9:16 
GeneralRe: Memory allocation problem?? Pin
pavanbabut28-Jul-06 9:32
pavanbabut28-Jul-06 9:32 
GeneralRe: Memory allocation problem?? Pin
Zac Howland28-Jul-06 9:46
Zac Howland28-Jul-06 9:46 
GeneralRe: Memory allocation problem?? Pin
pavanbabut1-Aug-06 5:32
pavanbabut1-Aug-06 5:32 
GeneralRe: Memory allocation problem?? Pin
Blake Miller1-Aug-06 12:44
Blake Miller1-Aug-06 12:44 
GeneralRe: Memory allocation problem?? Pin
pavanbabut2-Aug-06 9:40
pavanbabut2-Aug-06 9:40 
GeneralRe: Memory allocation problem?? Pin
Blake Miller2-Aug-06 10:29
Blake Miller2-Aug-06 10:29 
GeneralRe: Memory allocation problem?? Pin
pavanbabut2-Aug-06 13:48
pavanbabut2-Aug-06 13:48 
Questionnewbie requires guidance on named pipe application Pin
eeyor66628-Jul-06 6:31
eeyor66628-Jul-06 6:31 
QuestionHow to set a JPG image to a dialog background ? Pin
Vinod Sankaranarayanan28-Jul-06 6:25
Vinod Sankaranarayanan28-Jul-06 6:25 

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.