Click here to Skip to main content
15,913,219 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
Generalvalarray Pin
aguest30-May-03 11:07
aguest30-May-03 11:07 
GeneralLibrary Not Registered Pin
qur30-May-03 3:21
qur30-May-03 3:21 
GeneralRe: Library Not Registered Pin
Nick Parker30-May-03 18:58
protectorNick Parker30-May-03 18:58 
GeneralRe: Library Not Registered Pin
qur1-Jun-03 21:44
qur1-Jun-03 21:44 
GeneralRe: Library Not Registered Pin
Vi25-Jun-03 0:47
Vi25-Jun-03 0:47 
GeneralRe: Library Not Registered Pin
qur6-Jun-03 0:13
qur6-Jun-03 0:13 
GeneralRe: Library Not Registered Pin
Vi26-Jun-03 2:11
Vi26-Jun-03 2:11 
GeneralIcon to Bitmap conversion Pin
Bara Sab30-May-03 2:21
Bara Sab30-May-03 2:21 
I am facing a problem in converting an icon to a
bitmap. To copy a bitmap to another bitmap following
code works fine

/*for bitmap*/
HBITMAP _hbmp = LOADIMAG(...);

//creating a source memory DC and selecting a bitmap
in it
HDC srcDC = CreateCompatibleDC(::GetDC(m_hWnd));
SelectObject(srcDC,(HICON)_hbmp);

//creating a destination memory DC and selecting a
memory bitmap to it
HDC desDC = CreateCompatibleDC(::GetDC(m_hWnd));
hBitmap =
CreateCompatibleBitmap(::GetDC(m_hWnd),75,75);
SelectObject(desDC,(HBITMAP)hBitmap);

//copies source DC to memory DC resulting in a copy of
_hbmp in hBitmap
BitBlt(desDC,0,0,75,75,srcDC,0,0,SRCCOPY);

DeleteDC(srcDC);
DeleteDC(desDC);

But if you are converting a icon to a bitmap the same
code as above does not work

/*for icon*/
//loading icon
HICON _hbmp = LoadIcon(NULL,IDI_HAND);

//creating a source memory DC and selecting a bitmap
in it
HDC srcDC = CreateCompatibleDC(::GetDC(m_hWnd));
SelectObject(srcDC,(HICON)_hbmp);

//creating a destination memory DC and selecting a
memory bitmap to it
HDC desDC = CreateCompatibleDC(::GetDC(m_hWnd));
hBitmap =
CreateCompatibleBitmap(::GetDC(m_hWnd),75,75);
SelectObject(desDC,(HBITMAP)hBitmap);

//copies source DC to memory DC resulting in a copy of
_hbmp in hBitmap
BitBlt(desDC,0,0,75,75,srcDC,0,0,SRCCOPY);

DeleteDC(srcDC);
DeleteDC(desDC);

Any comment or help shall be highly appreciated.




Pah

GeneralRe: Icon to Bitmap conversion Pin
Ed Gadziemski30-May-03 9:44
professionalEd Gadziemski30-May-03 9:44 
GeneralRe: Icon to Bitmap conversion Pin
Michael Dunn30-May-03 11:30
sitebuilderMichael Dunn30-May-03 11:30 
GeneralRe: Icon to Bitmap conversion Pin
Ed Gadziemski4-Jun-03 13:14
professionalEd Gadziemski4-Jun-03 13:14 
GeneralRe: Icon to Bitmap conversion Pin
Michael Dunn4-Jun-03 15:32
sitebuilderMichael Dunn4-Jun-03 15:32 
GeneralRe: Icon to Bitmap conversion Pin
Ed Gadziemski4-Jun-03 16:32
professionalEd Gadziemski4-Jun-03 16:32 
GeneralI'm a beginner.... Pin
Jhon29-May-03 15:08
Jhon29-May-03 15:08 
GeneralRe: I'm a beginner.... Pin
Anonymous29-May-03 16:51
Anonymous29-May-03 16:51 
GeneralRe: I'm a beginner.... Pin
geo_m30-May-03 22:20
geo_m30-May-03 22:20 
GeneralRe: I'm a beginner.... Pin
sunjohn1-Jun-03 22:43
sunjohn1-Jun-03 22:43 
GeneralCompilation Error on map Pin
projyal27-May-03 21:16
projyal27-May-03 21:16 
GeneralRe: Compilation Error on map Pin
projyal27-May-03 22:05
projyal27-May-03 22:05 
GeneralRe: Compilation Error on map Pin
Joaquín M López Muñoz28-May-03 2:30
Joaquín M López Muñoz28-May-03 2:30 
Generaladd a DIALOGBAR Pin
aguest27-May-03 19:37
aguest27-May-03 19:37 
GeneralWTL: CFrameWindow question Pin
João Paulo Figueira27-May-03 1:28
professionalJoão Paulo Figueira27-May-03 1:28 
QuestionHow to Implement "Drag" in List View without using MFC Pin
Pious26-May-03 22:00
Pious26-May-03 22:00 
AnswerRe: How to Implement "Drag" in List View without using MFC Pin
AlexO27-May-03 6:30
AlexO27-May-03 6:30 
QuestionATL CString in C++ .net/2003 - to export or not? Pin
Peter Weyzen26-May-03 18:45
Peter Weyzen26-May-03 18:45 

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.