# I have a trouble to apply virtual background

**URL:** <https://devforum.zoom.us/t/i-have-a-trouble-to-apply-virtual-background/8784>\
**Category:** Meeting SDK\
**Created:** [March 17, 2020, 5:06am UTC](https://devforum.zoom.us/t/i-have-a-trouble-to-apply-virtual-background/8784 "2020-03-17T05:06:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![shenyantaoit](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@shenyantaoit](https://devforum.zoom.us/u/shenyantaoit)\
**Post date:** [March 17, 2020, 5:06am UTC](https://devforum.zoom.us/t/i-have-a-trouble-to-apply-virtual-background/8784/1 "2020-03-17T05:06:09Z")

</div>

Hello,dear  
I have a trouble to apply my virtual background，I tried to code as examples, it return success,but actually it doesn’t work.but demo runs rightly.is there anything I need to do?Please give me a favor。

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [March 17, 2020, 5:12am UTC](https://devforum.zoom.us/t/i-have-a-trouble-to-apply-virtual-background/8784/2 "2020-03-17T05:12:21Z")

</div>

Hi [shenyantaoit](https://devforum.zoom.us/u/shenyantaoit),

Thanks for using Zoom SDK. May I ask which SDK platform are you referring to(And which version?) and which interface is not working?

Thanks!

---

<div class="post-metadata">

**Author:** ![shenyantaoit](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@shenyantaoit](https://devforum.zoom.us/u/shenyantaoit)\
**Post date:** [March 17, 2020, 5:43am UTC](https://devforum.zoom.us/t/i-have-a-trouble-to-apply-virtual-background/8784/3 "2020-03-17T05:43:18Z")

</div>

Windows Sdk.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/1/10c57882f32b99c9f704cdf98075229612c92912.png)  
the sdk information is above,and this method IVirtualBGSettingContext::UseBGImage doesn’t work on my pc.  
I am a greenhand in zoomsdk,please give me a favor.

---

<div class="post-metadata">

**Author:** ![shenyantaoit](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@shenyantaoit](https://devforum.zoom.us/u/shenyantaoit)\
**Post date:** [March 18, 2020, 3:49am UTC](https://devforum.zoom.us/t/i-have-a-trouble-to-apply-virtual-background/8784/4 "2020-03-18T03:49:53Z")

</div>

hi,expert.  
Could you give me a favor?I want to change virtual background frequently，but it is unfriendly,it blocks my work.  
thank you.

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [March 18, 2020, 4:09am UTC](https://devforum.zoom.us/t/i-have-a-trouble-to-apply-virtual-background/8784/5 "2020-03-18T04:09:13Z")

</div>

Hi [shenyantaoit](https://devforum.zoom.us/u/shenyantaoit),

Thanks for the reply. Did you add the image using AddBGImage and get the image list using GetBGImageList before calling the UseBGImage? The UseBGImage only accepts the images that exist in the GetBGImageList. The corresponding interfaces are in [https://github.com/zoom/zoom-sdk-windows/blob/6295059767afa50e42ca8a59ce797a3001684c87/demo/sdk\_demo\_v2/SETTINGS\_virtualBG\_workflow.cpp](https://github.com/zoom/zoom-sdk-windows/blob/6295059767afa50e42ca8a59ce797a3001684c87/demo/sdk_demo_v2/SETTINGS_virtualBG_workflow.cpp)

You may refer to our demo app for the implementation: [https://github.com/zoom/zoom-sdk-windows/blob/6295059767afa50e42ca8a59ce797a3001684c87/demo/sdk\_demo\_v2/settings\_ui.cpp#L1655](https://github.com/zoom/zoom-sdk-windows/blob/6295059767afa50e42ca8a59ce797a3001684c87/demo/sdk_demo_v2/settings_ui.cpp#L1655)

If the above steps do not help and the issue persists, are you getting any error message or could you provide the steps of how to reproduce this issue with our demo app?

Thanks!

---

<div class="post-metadata">

**Author:** ![shenyantaoit](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@shenyantaoit](https://devforum.zoom.us/u/shenyantaoit)\
**Post date:** [March 18, 2020, 6:00am UTC](https://devforum.zoom.us/t/i-have-a-trouble-to-apply-virtual-background/8784/6 "2020-03-18T06:00:57Z")

</div>

Hi,Dear Chen,  
I did as demo\_v2,The following code segments come from my demo,

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/4/42f967a4608835ff0a04b015d10630ce13ce8a1c.png)  
and it runs correctly,but it doesn’t work.there is no error message,so I  
don’t know what to do.Is there anything I did wrong?I would  
appreciate it very much if you would help me with it.  
Thanks!

---

<div class="post-metadata">

**Author:** ![shenyantaoit](https://avatars.discourse-cdn.com/v4/letter/s/f19dbf/32.png) [@shenyantaoit](https://devforum.zoom.us/u/shenyantaoit)\
**Post date:** [March 18, 2020, 6:04am UTC](https://devforum.zoom.us/t/i-have-a-trouble-to-apply-virtual-background/8784/7 "2020-03-18T06:04:23Z")

</div>

Hi,Dear Chen,  
Please look at my last message,  
and my debug information is as below:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/5/5c43be16ba5cc920618e4a973fcecea5111a73e0.png)  
Thank you for your support.

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [March 20, 2020, 10:21pm UTC](https://devforum.zoom.us/t/i-have-a-trouble-to-apply-virtual-background/8784/8 "2020-03-20T22:21:47Z")

</div>

Hi [shenyantaoit](https://devforum.zoom.us/u/shenyantaoit),

Thanks for the reply and the code snippet, the code showing in the screenshot looks good to me, but using virtual background might more configurations, our demo app has the exact implementations of how to use the virtual background in SDK, you may refer to the following: [https://github.com/zoom/zoom-sdk-windows/blob/master/demo/sdk\_demo\_v2/settings\_ui.cpp#L1481](https://github.com/zoom/zoom-sdk-windows/blob/master/demo/sdk_demo_v2/settings_ui.cpp#L1481).

Hope this helps. Thanks!

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [March 21, 2020, 12:53am UTC](https://devforum.zoom.us/t/i-have-a-trouble-to-apply-virtual-background/8784/9 "2020-03-21T00:53:57Z")

</div>

Hi [shenyantaoit](https://devforum.zoom.us/t/i-have-a-trouble-to-apply-virtual-background/8784/7),

A few more tips that might be helpful:

1. Please call the following 3 interfaces first to see if the current meeting supports virtual background, and see the current status of the virtual background feature:
  - `virtual bool IsSupportVirtualBG()；`
  - `IsSupportSmartVirtualBG() ；`
  - `IsUsingGreenScreenOn()；`

2. Please add conditions to check whether the `AddBGImage()` is a success or not, and provide some time for the response before proceeding to the next action.
3. If it is still not working, please try to delete the folder `%AppData%/ZoomSDK` and try again.

Hope this helps. Thanks!

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 7:32pm UTC](https://devforum.zoom.us/t/i-have-a-trouble-to-apply-virtual-background/8784/10 "2020-08-21T19:32:33Z")

</div>

Closed on August 21, 2020, 7:32pm UTC


