MagImageScalingCallback doesn't work in secondary monitor

JunPing Li 1 Reputation point
2021-03-08T12:52:19.74+00:00

Hi, I'm using Magnification API to capture screenshoot, and I have some problems.
When I set up my magnifier window rect same as Secondary Monitor rect (such (1920,0,3840,1080)) , I can't get rgb data from MagImageScalingCallback.
Actually , MagImageScalingCallback can work normally on the primary monitor which rect is (0,0,1920,1080).
I can't find any doc to introduce how MagImageScalingCallback working on.
Can anybody tell me how to get rgb data from Secondary Monitor with Magnification API?
ps: my magnifier host window is showed as hidden.

Windows Hardware Performance
Windows Hardware Performance
Windows: A family of Microsoft operating systems that run across personal computers, tablets, laptops, phones, internet of things devices, self-contained mixed reality headsets, large collaboration screens, and other devices.Hardware Performance: Delivering / providing hardware or hardware systems or adjusting / adapting hardware or hardware systems.
1,575 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. Cymon Kilmer -MSFT 801 Reputation points
    2021-03-08T23:52:18.92+00:00

    From this documentation its noted that the MagImageScalingCallback was deprecated in Windows 7 and there is no replacement.

    https://learn.microsoft.com/en-us/windows/win32/api/magnification/nc-magnification-magimagescalingcallback


  2. JunPing Li 1 Reputation point
    2021-03-10T11:41:25.063+00:00

    Well, I wanna get the rgb data from magnifier window that show with SW_HIDE command. But I can't get data from this callback at secondary monitor

    0 comments No comments

  3. Krishandevan k 1 Reputation point
    2021-06-22T14:30:55.777+00:00

    @JunPing Li Did you get any fix for this ? Only way I see is like you have to capture secondary screen as parts and stich it.

    0 comments No comments

  4. Grey 5 Reputation points
    2023-01-18T07:27:03.0933333+00:00

    Hey,

    I test the code of webrtc screen_capturer_win_magnifier.cc, find that if you want use magnification API to capture sub screen, maybe you should satisfy following conditions:

    • make sure that the sum of left of host_window_ and magnifier_window_ is zero
    • make sure that the sum of top of host_window_ and magnifier_window_ is zero
    • make sure that the native_rect of MagSetWindowSource() equals to sub screen's position
    0 comments No comments