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

C / C++ / MFC

 
GeneralRe: Handle Reuse Problems? Pin
V3RO26-Feb-07 9:45
V3RO26-Feb-07 9:45 
GeneralRe: Handle Reuse Problems? Pin
Mark Salsbery26-Feb-07 10:16
Mark Salsbery26-Feb-07 10:16 
QuestionAccessing DLL Pin
vinith26-Feb-07 7:28
vinith26-Feb-07 7:28 
AnswerRe: Accessing DLL Pin
Mark Salsbery26-Feb-07 7:41
Mark Salsbery26-Feb-07 7:41 
GeneralRe: Accessing DLL Pin
vinith26-Feb-07 23:03
vinith26-Feb-07 23:03 
QuestionRe: Accessing DLL Pin
prasad_som26-Feb-07 19:48
prasad_som26-Feb-07 19:48 
QuestionMS Access Pin
shiraztk26-Feb-07 6:32
shiraztk26-Feb-07 6:32 
QuestionRe: MS Access Pin
David Crow26-Feb-07 9:04
David Crow26-Feb-07 9:04 
QuestionWhite space increased and one reference number jumped in simple console application Pin
Software_Specialist26-Feb-07 4:31
Software_Specialist26-Feb-07 4:31 
QuestionRe: White space increased and one reference number jumped in simple console application Pin
Newbie0026-Feb-07 6:24
Newbie0026-Feb-07 6:24 
AnswerRe: White space increased and one reference number jumped in simple console application Pin
Software_Specialist27-Feb-07 9:38
Software_Specialist27-Feb-07 9:38 
GeneralRe: White space increased and one reference number jumped in simple console application Pin
Newbie0028-Feb-07 3:28
Newbie0028-Feb-07 3:28 
QuestionMS Access ActiveX VC++ Pin
shiraztk26-Feb-07 3:58
shiraztk26-Feb-07 3:58 
AnswerRe: MS Access ActiveX VC++ Pin
James R. Twine26-Feb-07 4:16
James R. Twine26-Feb-07 4:16 
GeneralRe: MS Access ActiveX VC++ Pin
shiraztk26-Feb-07 4:35
shiraztk26-Feb-07 4:35 
QuestionVisual Studio Just-In-Time Debugger Pin
Try26-Feb-07 3:12
Try26-Feb-07 3:12 
AnswerRe: Visual Studio Just-In-Time Debugger Pin
James R. Twine26-Feb-07 3:18
James R. Twine26-Feb-07 3:18 
AnswerRe: Visual Studio Just-In-Time Debugger Pin
Cedric Moonen26-Feb-07 3:19
Cedric Moonen26-Feb-07 3:19 
GeneralRe: Visual Studio Just-In-Time Debugger Pin
Try26-Feb-07 3:26
Try26-Feb-07 3:26 
GeneralRe: Visual Studio Just-In-Time Debugger Pin
James R. Twine26-Feb-07 4:14
James R. Twine26-Feb-07 4:14 
Questionobjective c Pin
deeps_cute26-Feb-07 2:46
deeps_cute26-Feb-07 2:46 
QuestionRe: objective c Pin
Maximilien26-Feb-07 3:37
Maximilien26-Feb-07 3:37 
Questionto display thumbnails on ListView Pin
vasu_sri26-Feb-07 1:22
vasu_sri26-Feb-07 1:22 
how can i display the bmp, jpg, png image files as a thumbnails on MyListView.

this is my code in ListView class:

HANDLE hFile;
hFile = CreateFile( "C:\\Documents and Settings\\B.Srinivas\\My Documents\\My Pictures\\SkinDlg.bmp",
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL );

if( hFile == INVALID_HANDLE_VALUE )
{
MessageBox( "Invalid Handle", "ERROR", MB_ICONERROR);

}
else
{
// MessageBox( "File Opened successfully");
BYTE *Buffer;
DWORD p=SetFilePointer( hFile, 0x003, NULL, FILE_BEGIN );

Buffer = new BYTE [2359350];


//LPDWORD lpNumberOfBytesRead = NULL;
DWORD pp;
bitmap.bmType=0;

bitmap.bmWidth=1024;
bitmap.bmHeight=768;
bitmap.bmWidthBytes=1024;
bitmap.bmPlanes=1;
bitmap.bmBitsPixel=1;
bitmap.bmBits=(LPSTR)Buffer;

Bitmap image((WCHAR*)Buffer ,0);
Bitmap *bmPhoto = NULL;
CBitmap Bmp1;
Bmp1.SetBitmapBits(&bitmap,Buffer)

bmPhoto = new Bitmap( THUMBNAIL_WIDTH, THUMBNAIL_HEIGHT, PixelFormat24bppRGB );
// bmPhoto->SetResolution( 100,100);//image.GetHorizontalResolution(), image.GetVerticalResolution() );
//bmPhoto->SetResolution()

hBmp=CreateBitmapIndirect((BITMAP FAR*)&bitmap);
CDC *cdc=GetDC();
CDC *pMemDC=new CDC;
pMemDC->CreateCompatibleDC(cdc);
CBitmap *pOldBitmap=((CBitmap*)pMemDC->SelectObject(hBmp));
cdc->BitBlt(0,0,1024,768,pMemDC,0,0,SRCINVERT);
pMemDC->SelectObject(&pOldBitmap);
delete pMemDC;
}


please help me..Confused | :confused:

Regards,
Srinivas

AnswerRe: to display thumbnails on ListView Pin
James R. Twine26-Feb-07 1:35
James R. Twine26-Feb-07 1:35 
AnswerRe: to display thumbnails on ListView Pin
Naveen26-Feb-07 2:13
Naveen26-Feb-07 2:13 

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.