# CornerSize

# CornerSize

Artifact:[androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/shape/CornerSize.kt+class:androidx.compose.foundation.shape.CornerSize)  
Added in[1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)
Common/All
  - Cmn  

  ```
  interface CornerSize
  ```

*** ** * ** ***

Defines size of a corner in pixels. For example for rounded shape it can be a corner radius.

## Summary

|                              ### Public functions                               |
|---------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [toPx](https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize#toPx(androidx.compose.ui.geometry.Size,androidx.compose.ui.unit.Density))`(shapeSize: `[Size](https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size)`, density: `[Density](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density)`)` Converts the[CornerSize](https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize)to pixels. | Cmn |

## Public functions

### toPx

Cmn  
Added in[1.10.0-rc01](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.10.0-rc01)  

```
fun toPx(shapeSize: Size, density: Density): Float
```

Converts the[CornerSize](https://developer.android.com/reference/kotlin/androidx/compose/foundation/shape/CornerSize)to pixels.  

|                                              Parameters                                               |
|-------------------------------------------------------------------------------------------------------|------------------------------------|
| `shapeSize: `[Size](https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Size) | the size of the shape              |
| `density: `[Density](https://developer.android.com/reference/kotlin/androidx/compose/ui/unit/Density) | the current density of the screen. |

|                                     Returns                                     |
|---------------------------------------------------------------------------------|---------------------------------------|
| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | resolved size of the corner in pixels |