Stay organized with collections
Save and categorize content based on your preferences.
interface CorePixelDp
Summary
Public functions |
Float |
Convert dp to pixels
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-05-15 UTC.
[null,null,["Last updated 2025-05-15 UTC."],[],[],null,["# CorePixelDp\n===========\n\nArtifact: [androidx.constraintlayout:constraintlayout-core](/jetpack/androidx/releases/constraintlayout) \n[View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/core/state/CorePixelDp.java+class:androidx.constraintlayout.core.state.CorePixelDp) \nAdded in [1.1.1](/jetpack/androidx/releases/constraintlayout#1.1.1)\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/androidx/constraintlayout/core/state/CorePixelDp \"View this page in Java\")\n\n\n```\ninterface CorePixelDp\n```\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nSummary\n-------\n\n| ### Public functions |\n|---------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | [toPixels](/reference/kotlin/androidx/constraintlayout/core/state/CorePixelDp#toPixels(float))`(dp: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)`)` Convert dp to pixels |\n\nPublic functions\n----------------\n\n### toPixels\n\nAdded in [1.1.1](/jetpack/androidx/releases/constraintlayout#1.1.1) \n\n```\nfun toPixels(dp: Float): Float\n```\n\nConvert dp to pixels \n\n| Parameters |\n|---------------------------------------------------------------------------------------|------------------|\n| `dp: `[Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | the value in dip |\n\n| Returns |\n|---------------------------------------------------------------------------------|---------------------|\n| [Float](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) | the value in pixels |"]]