The scaling technique used in Shovel Knight is very interesting, it's a compromise between getting the largest canvas size possible, with minimal blurriness.
The steps as described in here by user gaxio:
https://gamedev.net/forums/topic/697710 ... n/5384340/
1) Get the client size (the drawable area) of the game window.
2) Find the integer number that scales your off-screen pixel art canvas to be as close in size as possible to the window client size, but not bigger than that window client size, and create your canvas in that scaled size.
That is, if your pixel art off-screen canvas is 320x240, and your game window client area is 800x600, then this integer factor is 2 (the canvas needs to be created as 2 x 320x240 = 640x480), because if you use 3 as the scale then the resulting size (960x720) will be bigger than the window size.
3) Draw graphics to your off-screen canvas, scaling them by that same integer factor (in this case, 2x), and drawn using
nearest-neighbor filtering, so no interpolation happens.
4) Draw the canvas itself on screen, scaled to fit the window, this using
bilinear filtering. The blurring will be kept very subtle.