# GoogleMobileAds.Api.AdSize

The size of a banner ad.

## Summary

**See also:**https://developers.google.com/admob/unity/banner::banner_sizes
Banner sizes.

| ### Constructors and Destructors ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a07655a37f6e2e2d5d448961b4d74ba61(int width, int height)` Creates a new [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size). ||

| ### Public types ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a9ef48b2ca6f308fc0113b760987d4a29` | enumThe type of banner ad. |

| ### Public static attributes ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a2a31c554fe0bde6ffbfe39f71c4cb396 = new AdSize(320, 50)` | `readonly https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size` Interactive Advertising Bureau (IAB) banner ad size (320x50 density-independent pixels). |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a02899c3ff952fd67b570932375d773d9 = -1` | `readonly int` The full width banner size. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a3e5546cbed71968758f04c9c2b080591 = new AdSize(468, 60)` | `readonly https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size` Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels). |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a7a3c896eea56dda30305cf97f773301c = new AdSize(320, 100)` | `readonly https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size` Large banner ad size (320x100 density-independent pixels). |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1af239e5bebbe046487056217c04445f90 = new AdSize(728, 90)` | `readonly https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size` Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels). |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a744724a26d59f412bf0279d3c7b7cb88 = new AdSize(300, 250)` | `readonly https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size` Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels). |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a4e8982d1b410a4821d4fd25f88402f2d = new AdSize(0, 0, Type.SmartBanner)` | `readonly https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size` A dynamically sized banner that is full-width and auto-height. |

| ### Properties ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a475692bb8665224999e2aa022e1424a6` | `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a9ef48b2ca6f308fc0113b760987d4a29` The type of banner ad. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a4cbf8b4ab31fc17cf72b3024d1037e6a` | `int` The height of the ad in density-independent pixels. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a0eeb5e0cfbffad28828821fbdb6698f1` | `int` The width of the ad in density-independent pixels. |

| ### Public functions ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a7cc4786bed642c72e9557777092aacda(object obj)` | `override bool` Returns whether the [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size) objects are equal. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a0eed2f400f9480027a0435cc88bcab00()` | `override int` Returns the hash code. |

| ### Public static functions ||
|---|---|
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a0704526951436f0703f5469de43430d8(int width)` | `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size` Gets a current orientation adaptive banner ad size. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1ac870166d7fce99a56c781bfb76d459fd(int width)` | `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size` Gets a large current orientation adaptive banner ad size. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1aca1677e41ae25ab12c398d0359d279ba(int width)` | `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size` Gets a landscape adaptive banner ad size. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1aa054f00ba0a53a27789e54434c776e66(int width)` | `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size` Gets a large landscape adaptive banner ad size. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a8a549a950e5f176a7311835b49e9b771(int width)` | `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size` Gets a large portrait adaptive banner ad size. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1ad6ddc71a78a8f559918871d8a68d945c(int width)` | `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size` Gets a portrait adaptive banner ad size. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1afbbe72c6b29c8a543b48b83c6fac33f8(https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size a, https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size b)` | `bool` Returns whether the [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size) objects are not equal. |
| `https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size_1a44641a4caca47877b0eb933aca074da1(https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size a, https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size b)` | `bool` Returns whether the [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size) objects are equal. |

## Public types

### Type

```c#
 Type
```
The type of banner ad.

## Public static attributes

### Banner

```c#
readonly AdSize Banner = new AdSize(320, 50)
```
Interactive Advertising Bureau (IAB) banner ad size (320x50 density-independent pixels).

### FullWidth

```c#
readonly int FullWidth = -1
```
The full width banner size.

### IABBanner

```c#
readonly AdSize IABBanner = new AdSize(468, 60)
```
Interactive Advertising Bureau (IAB) full banner ad size (468x60 density-independent pixels).

### LargeBanner

```c#
readonly AdSize LargeBanner = new AdSize(320, 100)
```
Large banner ad size (320x100 density-independent pixels).

### Leaderboard

```c#
readonly AdSize Leaderboard = new AdSize(728, 90)
```
Interactive Advertising Bureau (IAB) leaderboard ad size (728x90 density-independent pixels).

### MediumRectangle

```c#
readonly AdSize MediumRectangle = new AdSize(300, 250)
```
Interactive Advertising Bureau (IAB) medium rectangle ad size (300x250 density-independent pixels).

### SmartBanner

```c#
readonly AdSize SmartBanner = new AdSize(0, 0, Type.SmartBanner)
```
A dynamically sized banner that is full-width and auto-height.

## Properties

### AdType

```c#
Type AdType
```
The type of banner ad.

### Height

```c#
int Height
```
The height of the ad in density-independent pixels.

### Width

```c#
int Width
```
The width of the ad in density-independent pixels.

## Public functions

### AdSize

```c#
 AdSize(
  int width,
  int height
)
```
Creates a new [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size).

<br />

Details Parameters `width` The width of the ad in density-independent pixels. `height` The height of the ad in density-independent pixels.

### Equals

```c#
override bool Equals(
  object obj
)
```
Returns whether the [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size) objects are equal.

### GetHashCode

```c#
override int GetHashCode()
```
Returns the hash code.

## Public static functions

### GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth

```c#
AdSize GetCurrentOrientationAnchoredAdaptiveBannerAdSizeWithWidth(
  int width
)
```
Gets a current orientation adaptive banner ad size.

<br />

Details Parameters `width` The width of the ad in density-independent pixels. **Returns** A current orientation adaptive banner ad size.

### GetCurrentOrientationLargeAnchoredAdaptiveBannerAdSizeWithWidth

```c#
AdSize GetCurrentOrientationLargeAnchoredAdaptiveBannerAdSizeWithWidth(
  int width
)
```
Gets a large current orientation adaptive banner ad size.

<br />

Details Parameters `width` The width of the ad in density-independent pixels. **Returns** A large current orientation adaptive banner ad size.

### GetLandscapeAnchoredAdaptiveBannerAdSizeWithWidth

```c#
AdSize GetLandscapeAnchoredAdaptiveBannerAdSizeWithWidth(
  int width
)
```
Gets a landscape adaptive banner ad size.

<br />

Details Parameters `width` The width of the ad in density-independent pixels. **Returns** A landscape adaptive banner ad size.

### GetLargeLandscapeAnchoredAdaptiveBannerAdSizeWithWidth

```c#
AdSize GetLargeLandscapeAnchoredAdaptiveBannerAdSizeWithWidth(
  int width
)
```
Gets a large landscape adaptive banner ad size.

<br />

Details Parameters `width` The width of the ad in density-independent pixels. **Returns** A large landscape adaptive banner ad size.

### GetLargePortraitAnchoredAdaptiveBannerAdSizeWithWidth

```c#
AdSize GetLargePortraitAnchoredAdaptiveBannerAdSizeWithWidth(
  int width
)
```
Gets a large portrait adaptive banner ad size.

<br />

Details Parameters `width` The width of the ad in density-independent pixels. **Returns** A large portrait adaptive banner ad size.

### GetPortraitAnchoredAdaptiveBannerAdSizeWithWidth

```c#
AdSize GetPortraitAnchoredAdaptiveBannerAdSizeWithWidth(
  int width
)
```
Gets a portrait adaptive banner ad size.

<br />

Details Parameters `width` The width of the ad in density-independent pixels. **Returns** A portrait adaptive banner ad size.

### operator!=

```c#
bool operator!=(
  AdSize a,
  AdSize b
)
```
Returns whether the [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size) objects are not equal.

<br />

Details Parameters `a` The first [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size) object. `b` The second [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size) object. **Returns** True if the [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size) objects are not equal.

### operator==

```c#
bool operator==(
  AdSize a,
  AdSize b
)
```
Returns whether the [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size) objects are equal.

<br />

Details Parameters `a` The first [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size) object. `b` The second [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size) object. **Returns** True if the [AdSize](https://developers.google.com/admob/unity/reference/class/google-mobile-ads/api/ad-size#class_google_mobile_ads_1_1_api_1_1_ad_size) objects are equal.