Yandex Mobile Ads
Loading...
Searching...
No Matches
ScreenUtils.cs
Go to the documentation of this file.
1/*
2 * This file is a part of the Yandex Advertising Network
3 *
4 * Version for iOS (C) 2023 YANDEX
5 *
6 * You may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at https://legal.yandex.com/partner_ch/
8 */
9
10using YandexMobileAds.Common;
11using YandexMobileAds.Platforms;
12
13namespace YandexMobileAds
14{
15 public static class ScreenUtils
16 {
24 public static int ConvertPixelsToDp(int pixels)
25 {
26 IScreenClient client = YandexMobileAdsClientFactory.CreateScreenClient();
27 return (int)(pixels / client.GetScreenScale());
28 }
29 }
30}
static int ConvertPixelsToDp(int pixels)
Converts physical pixels to density independent pixels.