• Welcome to Dark Bit Factory & Gravity.
 

C++ Win32 - Using picturebox for painting program?

Started by va!n, June 12, 2015

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

va!n

Atm i am using DIB to handle and manipulate graphics/images in nearly realtime. For drawing and updating the image, i am using:


                hdc = BeginPaint(hWnd, &ps);
StretchDIBits(hdc, 1, 1, 1024, 480, 0, 0, 1024, 480, buffer, &bmi, DIB_RGB_COLORS, SRCCOPY);
EndPaint(hWnd, &ps);


Features i would like to add:  scrollbars/scrollarea, zoom in/out....

So whats the best way for a drawing program? Drawing image with StrechDIBIts directly to the window or scrollarea...
Or does it makes sense to use Win32 API picturebox for high flexibilty and even to have best performance/speed?
- hp EliteBook 8540p, 4 GB RAM, Windows 8.1 x64
- Asus P5Q, Intel Q8200, 6 GB DDR2, Radeon 4870, Windows 8.1 x64
http://www.secretly.de
Challenge Trophies Won:

Jim

For this application it probably doesn't make any difference if you use GDI or DirectX.  You're only doing one blit, so as long as there's no colour conversion or scaling going on (your source and dest DIB have the same size and bit-depth) then they probably end up going through the same underlying API anyway.

Jim
Challenge Trophies Won: