BitBlt() function performance question
-
Hi, in a windows CE platform, I tested BitBlt() function, I found it will take about 400 millisecdons to do:
MemBoard.CreateCompatibleDC(&dc);
bmpDashBoard.LoadBitmap( IDB_SCREEN_IMP );
pOldBmp = (CBitmap*)Memboard.SelectObject(&bmpBoard);
...
MemDC.CreateCompatibleDC(dc);
..
MemDC.BitBlt(0,0, 800,600,&Memboard, 0, 0, SRCCOPY);is there anyway to speed up BitBlt() function?
-
Hi, in a windows CE platform, I tested BitBlt() function, I found it will take about 400 millisecdons to do:
MemBoard.CreateCompatibleDC(&dc);
bmpDashBoard.LoadBitmap( IDB_SCREEN_IMP );
pOldBmp = (CBitmap*)Memboard.SelectObject(&bmpBoard);
...
MemDC.CreateCompatibleDC(dc);
..
MemDC.BitBlt(0,0, 800,600,&Memboard, 0, 0, SRCCOPY);is there anyway to speed up BitBlt() function?
are you saying it takes 400ms to do all of that, or just the BitBlt? because you can do the LoadBitmap ahead of time and just keep the CBitmap around for when you need it.
-
are you saying it takes 400ms to do all of that, or just the BitBlt? because you can do the LoadBitmap ahead of time and just keep the CBitmap around for when you need it.
I can't get precise time, but, with old BitBlt(), not a 800*600 bitmap, I set tick count array in program, tkCount[15]-tkCount[14] = tkCount[14] - tkCount[13] ... = tkCount[1] - tkCount[0] = 170 ms around. Then I use new BitBlt() to load 800*600 bitmap, it gives 400ms around. So I should say it added 230 ms. Old BitBlt() just transport about 1/5 or 1/6 part of 800*600 bitmap. I expected to use a 800*600(the screen area) memory DC to hold all parts changes, then BitBlt() to screen. Now that 800*600 tooks so much time, I don't think a double buffer technique is helpful.
-
Hi, in a windows CE platform, I tested BitBlt() function, I found it will take about 400 millisecdons to do:
MemBoard.CreateCompatibleDC(&dc);
bmpDashBoard.LoadBitmap( IDB_SCREEN_IMP );
pOldBmp = (CBitmap*)Memboard.SelectObject(&bmpBoard);
...
MemDC.CreateCompatibleDC(dc);
..
MemDC.BitBlt(0,0, 800,600,&Memboard, 0, 0, SRCCOPY);is there anyway to speed up BitBlt() function?
I doubt it's the BitBlt slowing you down that much. You probably shouldn't be loading a bitmap every single time, load it once and keep it in memory for better results.
-
Hi, in a windows CE platform, I tested BitBlt() function, I found it will take about 400 millisecdons to do:
MemBoard.CreateCompatibleDC(&dc);
bmpDashBoard.LoadBitmap( IDB_SCREEN_IMP );
pOldBmp = (CBitmap*)Memboard.SelectObject(&bmpBoard);
...
MemDC.CreateCompatibleDC(dc);
..
MemDC.BitBlt(0,0, 800,600,&Memboard, 0, 0, SRCCOPY);is there anyway to speed up BitBlt() function?
-
Hi, in a windows CE platform, I tested BitBlt() function, I found it will take about 400 millisecdons to do:
MemBoard.CreateCompatibleDC(&dc);
bmpDashBoard.LoadBitmap( IDB_SCREEN_IMP );
pOldBmp = (CBitmap*)Memboard.SelectObject(&bmpBoard);
...
MemDC.CreateCompatibleDC(dc);
..
MemDC.BitBlt(0,0, 800,600,&Memboard, 0, 0, SRCCOPY);is there anyway to speed up BitBlt() function?
-
Do you handled CDC::SetStretchBltMode[^] ? Depend on this settings, you will have rendering speed or render quality ...
-
I doubt it's the BitBlt slowing you down that much. You probably shouldn't be loading a bitmap every single time, load it once and keep it in memory for better results.
-
Yes, I know redraw picture is a time-costing work. But, the application need to update picture with the real-time data.
I do real-time drawing... bitblt() is your friend, you're probably doing something else that's slow.
-
I do real-time drawing... bitblt() is your friend, you're probably doing something else that's slow.
-
The background picture is 800*600, 24 color depth, so it is about 1.44 MB. Did you think the picture size would affect the BitBlt() speed?
I'm sure it would... but not to the extent that your numbers reflect. You're doing something else wrong (or... more precisely, you're doing something else that's slowing the process down).
-
Hi, in a windows CE platform, I tested BitBlt() function, I found it will take about 400 millisecdons to do:
MemBoard.CreateCompatibleDC(&dc);
bmpDashBoard.LoadBitmap( IDB_SCREEN_IMP );
pOldBmp = (CBitmap*)Memboard.SelectObject(&bmpBoard);
...
MemDC.CreateCompatibleDC(dc);
..
MemDC.BitBlt(0,0, 800,600,&Memboard, 0, 0, SRCCOPY);is there anyway to speed up BitBlt() function?
Hey why not using DirectX ,it uses Double buffering algorithm
-
I can't get precise time, but, with old BitBlt(), not a 800*600 bitmap, I set tick count array in program, tkCount[15]-tkCount[14] = tkCount[14] - tkCount[13] ... = tkCount[1] - tkCount[0] = 170 ms around. Then I use new BitBlt() to load 800*600 bitmap, it gives 400ms around. So I should say it added 230 ms. Old BitBlt() just transport about 1/5 or 1/6 part of 800*600 bitmap. I expected to use a 800*600(the screen area) memory DC to hold all parts changes, then BitBlt() to screen. Now that 800*600 tooks so much time, I don't think a double buffer technique is helpful.
what do you mean "old" and "new" BitBlt ?
-
Hey why not using DirectX ,it uses Double buffering algorithm
-
Hi, in a windows CE platform, I tested BitBlt() function, I found it will take about 400 millisecdons to do:
MemBoard.CreateCompatibleDC(&dc);
bmpDashBoard.LoadBitmap( IDB_SCREEN_IMP );
pOldBmp = (CBitmap*)Memboard.SelectObject(&bmpBoard);
...
MemDC.CreateCompatibleDC(dc);
..
MemDC.BitBlt(0,0, 800,600,&Memboard, 0, 0, SRCCOPY);is there anyway to speed up BitBlt() function?
If it's indeed the blit sucking that much time, prime suspect would be format conversion. Check out
GetObject()
for BITMAP, to see what the format of src and dest are. I'm willing to bet 3 lines of C++ that they are different. :-)