Click here to Skip to main content
15,911,711 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ofstream writes strings instead of unsigned ints? Pin
Bob Stanneveld24-May-05 2:20
Bob Stanneveld24-May-05 2:20 
AnswerRe: ofstream writes strings instead of unsigned ints? Pin
nm_11424-May-05 11:36
nm_11424-May-05 11:36 
GeneralRe: ofstream writes strings instead of unsigned ints? Pin
Bob Stanneveld25-May-05 2:27
Bob Stanneveld25-May-05 2:27 
QuestionHow to stop resizing of spliiter windows Pin
nripun23-May-05 21:34
nripun23-May-05 21:34 
AnswerRe: How to stop resizing of spliiter windows Pin
Priyank Bolia25-May-05 0:18
Priyank Bolia25-May-05 0:18 
GeneralDisplay DIB when I have its handle (HBITMAP) Pin
ninck23-May-05 21:23
ninck23-May-05 21:23 
GeneralRe: Display DIB when I have its handle (HBITMAP) Pin
Flit24-May-05 2:07
Flit24-May-05 2:07 
GeneralRe: Display DIB when I have its handle (HBITMAP) Pin
ninck24-May-05 4:01
ninck24-May-05 4:01 
Well that's what I did ,basically . As you can see bellow I also have a function which makes my DIB from a DDB(the funnction is ConvertToDIB).I called this function before the SelectObject call .I don't know why I can't display the DIB (I see a white window when I try to open an image).
I transformed the DDB into DIB so I can modify it (for now I don't know how to modify it , but I just want to display it first ).Here's the code :
void CDoiView::OnInitialUpdate()
{
CScrollView::OnInitialUpdate();

CSize sizeTotal;
sizeTotal.cx = sizeTotal.cy = 0;

CleanUp();

CDoiDoc* pDoc = GetDocument();
CString strPath = pDoc->GetPathName();
if (!strPath.IsEmpty())
m_handlerToBMP = GetBitmapFromFile(strPath);

if (m_handlerToBMP){

GetBitmapDimensionEx(m_handlerToBMP, &sizeTotal);
}

SetScrollSizes(MM_TEXT, sizeTotal);

CDC* pDC=GetDC();
HDC hMemDC;
hMemDC=CreateCompatibleDC(pDC->GetSafeHdc());
if (hMemDC)
{
if (m_handlerToBMP){


bool aa;
if ( (aa=ConvertToDIB(m_handlerToBMP))==false )
{ AfxMessageBox("eroare ConvertToDIB");}


// select new bitmap into memory DC
HBITMAP hOldBitmap = (HBITMAP)SelectObject(hMemDC, m_handlerToBMP);
//alocam memorie pentru tabloul ce contine informatia despre culoarea pixelilor

GetBitmapDimensionEx(m_handlerToBMP, &sizeTotal);

//transfer din memorie in fereastra
::BitBlt(pDC->GetSafeHdc(),0,0,sizeTotal.cx,sizeTotal.cy,hMemDC,0,0,SRCCOPY);
// select old bitmap back into memory DC and get handle to bitmap
SelectObject(hMemDC, hOldBitmap);
DeleteObject(hOldBitmap);
DeleteDC(hMemDC);
}
Invalidate();
UpdateWindow();
}

}
GeneralCalling VC dll in VB application Pin
Jangid23-May-05 21:18
Jangid23-May-05 21:18 
QuestionWhat are different method to load any image from file Pin
amrutajoshi23-May-05 21:04
amrutajoshi23-May-05 21:04 
AnswerRe: What are different method to load any image from file Pin
ThatsAlok23-May-05 21:12
ThatsAlok23-May-05 21:12 
GeneralRe: What are different method to load any image from file Pin
Stlan23-May-05 21:22
Stlan23-May-05 21:22 
GeneralRe: What are different method to load any image from file Pin
ThatsAlok23-May-05 21:29
ThatsAlok23-May-05 21:29 
GeneralRe: What are different method to load any image from file Pin
Stlan23-May-05 21:36
Stlan23-May-05 21:36 
GeneralRe: What are different method to load any image from file Pin
amrutajoshi24-May-05 0:06
amrutajoshi24-May-05 0:06 
GeneralRe: What are different method to load any image from file Pin
ThatsAlok24-May-05 0:10
ThatsAlok24-May-05 0:10 
GeneralRe: What are different method to load any image from file Pin
amrutajoshi24-May-05 2:12
amrutajoshi24-May-05 2:12 
GeneralRe: What are different method to load any image from file Pin
ThatsAlok24-May-05 2:17
ThatsAlok24-May-05 2:17 
AnswerRe: What are different method to load any image from file Pin
Stlan23-May-05 21:20
Stlan23-May-05 21:20 
GeneralMSHTML OnSubmit Customised Function Pin
Member 161855823-May-05 21:02
Member 161855823-May-05 21:02 
GeneralEncoding Technique Pin
Rashaida23-May-05 19:56
sussRashaida23-May-05 19:56 
Generaloperator new Pin
vikramlinux23-May-05 19:50
vikramlinux23-May-05 19:50 
GeneralRe: operator new Pin
itkid23-May-05 20:14
itkid23-May-05 20:14 
GeneralRe: operator new Pin
vikramlinux23-May-05 20:19
vikramlinux23-May-05 20:19 
GeneralRe: operator new Pin
Bob Stanneveld23-May-05 20:27
Bob Stanneveld23-May-05 20:27 

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.