But with the company's library drawing as long as 6 to 20 milliseconds can finish, I want to ask what is the solution, is my problem or the function itself, or what is the optimal method,
SYSTEMTIME TimeStart, TimeEnd;
GetLocalTime (& amp; TimeStart);//start time
StretchDIBits (pDC - & gt; GetSafeHdc (), 0, 0, rcRect Width (), rcRect. Height (),
DImageXStartPos dImageYStartPos,
(int) (GetBitMapInfoHeader (.) biWidth/m_dZoomWidth), (int) (GetBitMapInfoHeader () biHeight/
M_dZoomHeight),
M_pcBufImage (BITMAPINFO *) m_pBitmapInfo_8, DIB_RGB_COLORS, SRCCOPY);
GetLocalTime (& amp; TimeEnd);//end time
Float fDetaTime=TimeEnd) wMilliseconds - TimeStart) wMilliseconds + 1000 * (TimeEnd) wSecond - TimeStart) wSecond);
CodePudding user response:
Change StretchDIBits first parameter to a memory DC and best operate pixels directly in memory bitmap operations, into a DIB format, directly to memcpy modified pixelsCodePudding user response:
In the memory DC painting, copy againCodePudding user response:
Use DX?CodePudding user response:
Brother can reply to the specific points on the second floorCodePudding user response:
Similar with double buffering mechanism, save the file with a memory DC, DC to DC operation soon,CodePudding user response:
Changes the D2D, I also in use recently, C: \ Program Files \ Microsoft Visual Studio (x86) 10.0 \ Samples \ 2052 \ VC2010SP1Samples there are many examples in the zipCodePudding user response:
This API with before, I do have a very time consuming, suggest you search search better third-party librariesCodePudding user response:
Has been solved, I do have a halftone takes seriously, with the memory DC + StretchDIBits can prevent screen flicker, but as slow StretchDIBits, I switched to STRETCH_DELETESCANS speed as fast as the company library, and some 300 million after a larger image to reduce the distortion, but look at the company library, distortion, same company library effect is slightly better than STRETCH_DELETESCANS began to shrink, just slightly better, with the method of estimation is also narrow is directly proportional sampling pixels, is not a difference,I do is a mouse drag images, amplification, narrow, small picture doesn't matter, big image is slow, I can't find understand reason, actually StretchDIBits HALFTONE pattern really slow this function itself, but the effect is very good, if you want to do better, estimates that need to change a tool,
CodePudding user response:
Thank you, to summarize, think fast and don't think so estimated distortion wingdi or poor, can try other dx, for example, OpenGL