Dark Bit Factory & Gravity

PROGRAMMING => C / C++ /C# => Topic started by: va!n on June 12, 2015

Title: C++ Win32 - Using picturebox for painting program?
Post by: va!n on June 12, 2015
Atm i am using DIB to handle and manipulate graphics/images in nearly realtime. For drawing and updating the image, i am using:

Code: [Select]
                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?
Title: Re: C++ Win32 - Using picturebox for painting program?
Post by: Jim on August 03, 2015
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