API Reference > imodeljs-frontend > Views > Viewport > cssPixelsToDevicePixels cssPixelsToDevicePixels Method Beta Convert a number in CSS pixels to device pixels using this Viewport's device pixel ratio. See: https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio cssPixelsToDevicePixels(cssPixels: number): number Parameter Type Description cssPixels number Returns - number The resulting number in device pixels Defined in core/frontend/src/Viewport.ts Line 2285 Last Updated: 13 June, 2024