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

C / C++ / MFC

 
GeneralRe: Multithreading in C++ Pin
Diddy4-Feb-04 4:30
Diddy4-Feb-04 4:30 
QuestionHow do i get handle to window in IE Pin
User 2155973-Feb-04 23:41
User 2155973-Feb-04 23:41 
AnswerRe: How do i get handle to window in IE Pin
Amr Abdel-Mohsen4-Feb-04 9:20
Amr Abdel-Mohsen4-Feb-04 9:20 
Generalprinting a html file Pin
Member 5281553-Feb-04 22:53
Member 5281553-Feb-04 22:53 
GeneralRe: printing a html file Pin
Anonymous4-Feb-04 11:22
Anonymous4-Feb-04 11:22 
Generalsingleton problem Pin
yccheok3-Feb-04 22:19
yccheok3-Feb-04 22:19 
GeneralRe: singleton problem Pin
Cristian Teodorescu3-Feb-04 23:01
Cristian Teodorescu3-Feb-04 23:01 
QuestionWhy slower draws on Screen with HW Accel. set to FULL? Pin
uus993-Feb-04 21:46
uus993-Feb-04 21:46 
I have a question regarding Slow StretchBlt when Video Full Hardware Acceleration

is Enabled in WIndows XP.

Here is my computer's spec, (also on a Dell P4 2gHz)

AMD AthlonXP 2000+
512MB DDR266
WD 7200 40GB HD +8MB Cache
GeForce 4MX 440 64MB AGP 4x
Windows XP+SP1a+All current updates
Visual C++ 6 +SP5

I have noticed that when i switch off HW Acceleration that is set to NONE (Display

Prop>Advanced>Troubleshoot>Video HW Acceleration>None) i get faster drawing on

screen with StretchBlt upto 4-6times faster. When i switch HW Acceleration to

FULL, the drawing becomes slower. Here is a sample code that opens a CAPTURE.bmp

file of 360x360 pixel and StretchBlts to screen.
//-------------------------------------------------------

void CSlowBltDlg::OnOK()
{
//timer
CElapsed m_el;
CDC memDCLoad;
CDC *pDC;
CBitmap m_bmpBitmap;
pDC = this->GetDC();

int x_width=360;
int y_height=360;

pDC->SetStretchBltMode(COLORONCOLOR);

LoadBitmap(this,&memDCLoad);
//start timer
m_el.Begin();
pDC->StretchBlt(20,30,200,200,&memDCLoad,0,0,x_width,y_height,SRCCOPY);

//end timer and show on screen
m_el.End();
CString szTime;
szTime.Format("Time = %.3fms", m_el.m_dElapsed*1000);
pDC->TextOut(10, 10, szTime);

}

void LoadBitmap(CSlowBltDlg *myDlg, CDC *memDCLoad)
{
CDC *pDC;
CBitmap m_bmpBitmap;
pDC = myDlg->GetDC();
CString m_sBitmap;

memDCLoad->CreateCompatibleDC(pDC);


static char BASED_CODE szFilter[] = "Bitmap Files (*.bmp)|*.bmp||";
// Create the File Open Dialog
CFileDialog m_ldFile(TRUE, "*.bmp", m_sBitmap,
OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter);

if (m_ldFile.DoModal() == IDOK)
{
m_sBitmap = m_ldFile.GetPathName();

HBITMAP hBitmap =(HBITMAP)::LoadImage(AfxGetInstanceHandle(),m_sBitmap,IMAGE_BITMAP,0,0,
LR_LOADFROMFILE|LR_DEFAULTCOLOR);

if(hBitmap)
{
if(m_bmpBitmap.DeleteObject())
m_bmpBitmap.Detach();
m_bmpBitmap.Attach(hBitmap);
}

memDCLoad->SelectObject(&m_bmpBitmap);

}
}
//Timing requires CElapsed class available in zip file.. see below

//-------------------------------------------------------
With HW Acc. Full= 6.01ms
With HW Acc. None= 0.8ms

Isnt HW Acc. supposed to make drawing faster? Please comment. I am doing a

realtime image processing program and time is crucial. My current program

StretchBlts with other processing takes 252ms per frame of an image captured from

somewhere (360x360 px) on a Dell Pentium 4 2Ghz with ATI Rage 64MB card(not sure

the card type but it is ATI). Switching of HW Acceleration yields a supprising

result of only 63ms per frame at same dpi. Why is that so? Frame capture is choppy

with HW Acce ON. Is there something i must do to my app to take full advantage of

HW Acc? Thanks

The complete source & exe also available here
http://ucsnet.hypermart.net/SlowBlt.zip
Generallib/dll file question Pin
bryce3-Feb-04 21:45
bryce3-Feb-04 21:45 
GeneralRe: lib/dll file question Pin
bryce3-Feb-04 22:15
bryce3-Feb-04 22:15 
GeneralRe: lib/dll file question Pin
goozmo3-Feb-04 22:37
goozmo3-Feb-04 22:37 
GeneralDatabase environment Pin
JensB3-Feb-04 21:38
JensB3-Feb-04 21:38 
GeneralRe: Database environment Pin
Roger Wright4-Feb-04 4:00
professionalRoger Wright4-Feb-04 4:00 
GeneralCan't not read string correctly from resource Pin
Paul.Huang3-Feb-04 20:26
Paul.Huang3-Feb-04 20:26 
GeneralRe: Can't not read string correctly from resource Pin
Diddy4-Feb-04 2:23
Diddy4-Feb-04 2:23 
GeneralRe: Can't not read string correctly from resource Pin
Paul.Huang4-Feb-04 14:52
Paul.Huang4-Feb-04 14:52 
GeneralRe: Can't not read string correctly from resource Pin
Diddy4-Feb-04 23:40
Diddy4-Feb-04 23:40 
Generalcpu info Pin
r i s h a b h s3-Feb-04 20:02
r i s h a b h s3-Feb-04 20:02 
GeneralRe: cpu info Pin
Jijo.Raj3-Feb-04 21:53
Jijo.Raj3-Feb-04 21:53 
GeneralRe: cpu info Pin
Alexander M.,4-Feb-04 3:11
Alexander M.,4-Feb-04 3:11 
GeneralDoubt ! TAB Messages from child dialog is not going to child dialogs message queue! Pin
Ilamparithi3-Feb-04 19:23
Ilamparithi3-Feb-04 19:23 
GeneralRe: Doubt ! TAB Messages from child dialog is not going to child dialogs message queue! Pin
Diddy4-Feb-04 2:26
Diddy4-Feb-04 2:26 
GeneralMultiple doc/view pairs Pin
flip3-Feb-04 19:23
flip3-Feb-04 19:23 
GeneralRe: Multiple doc/view pairs Pin
Roger Allen4-Feb-04 2:22
Roger Allen4-Feb-04 2:22 
GeneralAccessing the statusbar in a worker thread problem Pin
J.B.3-Feb-04 19:15
J.B.3-Feb-04 19:15 

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.