If Windows, you need to find the handle for the window you want to take a screenshot of, figure out its dimensions to determine the size of the bitmap, then create a bitmap and fill in the bitmap.
there must be some terminology mixup. Browsers certainly have their window when showing an image. If it has a full screen option, that is another story, are you in fullscreen? If so, get the whole screen as your capture.
screenshots of images are lower quality than just fetching the original image from the browser's cache (tricky... names are just junk) or going to the site and getting it yourself.
I think you can get the entire screen, all open programs, start menu, desktop background, etc. It gets things you don't want, but it may be easier to code.
Tell us exactly what you want to do, and more importantly, why. Otherwise, this smells like one of those "XY problems". Perhaps you are looking for something like wget, to download content from a webpage.
There is no graphical I/O with ISO standard C++, doing what you seem to want requires a third party library.
Since you are on Windows the "best" 3rd party library is the Win API. Fair warning, what constitutes the API is a HUUUUGE undertaking. And a lot of 'net referenced material is not well documented and, well, frankly, grossly out of date with regards to the new technologies Windows has.
I think OP wants the equivalent of wget, to download an image? I believe wget uses its own back-end library, but I could be mistaken (check the source). https://www.gnu.org/software/wget/
There is also cURL, which has its own library, libcurl, which is a library for transferring files and can work over HTTP and HTTPS. https://curl.se/libcurl/
So you'd either need to build one of these libraries yourself (probably curl), or, depending on what your needs are, you could probably get away with just invoking wget or curl from your program or from the command-line.
e.g.