<div class='sourceset sourceset-android'>Android</div>

```kotlin
public open class RemoteDrawScope
internal constructor(
    @get:RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) public val remoteCanvas: RemoteCanvas
) : RemoteStateScope by remoteCanvas
```

A remote-compatible drawing scope for RemoteCompose. Unlike [DrawScope](/jetpack-compose/androidx.compose.ui/ui-graphics/interfaces/DrawScope), this class uses remote
types consistently and does not attempt to implement the standard [DrawScope](/jetpack-compose/androidx.compose.ui/ui-graphics/interfaces/DrawScope) interface to avoid
API incompatibilities.

## Functions

<h2 id="usepaint-paint-block">usePaint</h2>

```kotlin
public fun usePaint(paint: RemotePaint, block: () -> Unit)
```

<hr class="docs-overload-divider">

<h2 id="drawrect-paint-topleft-size">drawRect</h2>

```kotlin
public fun drawRect(
        paint: RemotePaint?,
        topLeft: RemoteOffset = RemoteOffset.Zero,
        size: RemoteSize = this@RemoteDrawScope.size,
    )
```

<hr class="docs-overload-divider">

<h2 id="drawroundrect-paint-topleft-size-cornerradius">drawRoundRect</h2>

```kotlin
public fun drawRoundRect(
        paint: RemotePaint?,
        topLeft: RemoteOffset = RemoteOffset.Zero,
        size: RemoteSize = this@RemoteDrawScope.size,
        cornerRadius: RemoteOffset = RemoteOffset.Zero,
    )
```

<hr class="docs-overload-divider">

<h2 id="drawcircle-paint-center-radius">drawCircle</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawCircle(
        paint: RemotePaint?,
        center: RemoteOffset = this@RemoteDrawScope.center,
        radius: RemoteFloat,
    )
```

Draws a circle.

<hr class="docs-overload-divider">

<h2 id="drawoval-paint-topleft-size">drawOval</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawOval(
        paint: RemotePaint?,
        topLeft: RemoteOffset = RemoteOffset.Zero,
        size: RemoteSize = this@RemoteDrawScope.size,
    )
```

<hr class="docs-overload-divider">

<h2 id="drawarc-paint-startangle-sweepangle-usecenter-topleft-size">drawArc</h2>

```kotlin
public fun drawArc(
        paint: RemotePaint?,
        startAngle: RemoteFloat,
        sweepAngle: RemoteFloat,
        useCenter: Boolean,
        topLeft: RemoteOffset = RemoteOffset.Zero,
        size: RemoteSize = this@RemoteDrawScope.size,
    )
```

<hr class="docs-overload-divider">

<h2 id="drawline-paint-start-end">drawLine</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawLine(paint: RemotePaint?, start: RemoteOffset, end: RemoteOffset)
```

Draws a line.

<hr class="docs-overload-divider">

<h2 id="drawimage-image-topleft-paint">drawImage</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawImage(
        image: RemoteBitmap,
        topLeft: RemoteOffset = RemoteOffset.Zero,
        paint: RemotePaint? = RemotePaint(),
    )
```

<hr class="docs-overload-divider">

<h2 id="drawscaledbitmap-image-srcoffset-srcsize-dstoffset-dstsize-scaletype-scalefactor-contentdescription">drawScaledBitmap</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawScaledBitmap(
        image: RemoteBitmap,
        srcOffset: RemoteOffset = RemoteOffset.Zero,
        srcSize: RemoteSize = RemoteSize(image.width, image.height),
        dstOffset: RemoteOffset = RemoteOffset.Zero,
        dstSize: RemoteSize = size,
        scaleType: ContentScale = ContentScale.Fit,
        scaleFactor: RemoteFloat = 1f.rf,
        contentDescription: String? = null,
    )
```

Draws a bitmap scaled to the destination rectangle.

<hr class="docs-overload-divider">

<h2 id="drawpath-path-paint">drawPath</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawPath(path: RemotePath, paint: RemotePaint?)
```

Draws a path.

<hr class="docs-overload-divider">

<h2 id="drawroundedpolygon-roundedpolygon-paint">drawRoundedPolygon</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawRoundedPolygon(roundedPolygon: RoundedPolygon, paint: RemotePaint?)
```

Draws a rounded polygon.

<hr class="docs-overload-divider">

<h2 id="drawroundedpolygonmorph-from-to-progress-paint">drawRoundedPolygonMorph</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawRoundedPolygonMorph(
        from: RoundedPolygon,
        to: RoundedPolygon,
        progress: RemoteFloat,
        paint: RemotePaint?,
    )
```

Draws a morph between two rounded polygons.

<hr class="docs-overload-divider">

<h2 id="drawtweenpath-path1-path2-tween-start-stop-paint">drawTweenPath</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawTweenPath(
        path1: RemotePath,
        path2: RemotePath,
        tween: RemoteFloat,
        start: RemoteFloat = 0f.rf,
        stop: RemoteFloat = 1f.rf,
        paint: RemotePaint?,
    )
```

Draws a tween path.

<hr class="docs-overload-divider">

<h2 id="drawtext-text-x-y-paint">drawText</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawText(text: RemoteString, x: RemoteFloat, y: RemoteFloat, paint: RemotePaint?)
```

Draws text.

<hr class="docs-overload-divider">

<h2 id="drawanchoredtext-text-anchorx-anchory-panx-pany-flags-paint">drawAnchoredText</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawAnchoredText(
        text: RemoteString,
        anchorX: RemoteFloat,
        anchorY: RemoteFloat,
        panX: RemoteFloat = 0f.rf,
        panY: RemoteFloat = 0f.rf,
        flags: Int = 0,
        paint: RemotePaint?,
    )
```

<hr class="docs-overload-divider">

<h2 id="drawtextonpath-text-path-hoffset-voffset-paint">drawTextOnPath</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawTextOnPath(
        text: RemoteString,
        path: RemotePath,
        hOffset: RemoteFloat = 0f.rf,
        vOffset: RemoteFloat = 0f.rf,
        paint: RemotePaint?,
    )
```

<hr class="docs-overload-divider">

<h2 id="rotate-degrees-block">rotate</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun rotate(degrees: RemoteFloat, block: RemoteDrawScope.() -> Unit)
```

Performs a rotation.

<hr class="docs-overload-divider">

<h2 id="rotate-degrees-pivot-block">rotate</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun rotate(
        degrees: RemoteFloat,
        pivot: RemoteOffset,
        block: RemoteDrawScope.() -> Unit,
    )
```

Performs a rotation.

<hr class="docs-overload-divider">

<h2 id="translate-left-top-block">translate</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun translate(left: RemoteFloat, top: RemoteFloat, block: RemoteDrawScope.() -> Unit)
```

Performs a translation.

<hr class="docs-overload-divider">

<h2 id="scale-scale-block">scale</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun scale(scale: RemoteFloat, block: RemoteDrawScope.() -> Unit)
```

Performs a scaling.

<hr class="docs-overload-divider">

<h2 id="scale-scalex-scaley-block">scale</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun scale(scaleX: RemoteFloat, scaleY: RemoteFloat, block: RemoteDrawScope.() -> Unit)
```

Performs a scaling.

<hr class="docs-overload-divider">

<h2 id="scale-scalex-scaley-pivot-block">scale</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun scale(
        scaleX: RemoteFloat,
        scaleY: RemoteFloat,
        pivot: RemoteOffset,
        block: RemoteDrawScope.() -> Unit,
    )
```

Performs a scaling.

<hr class="docs-overload-divider">

<h2 id="withtransform-transformblock-drawblock">withTransform</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun withTransform(
        transformBlock: RemoteCanvas.() -> Unit,
        drawBlock: RemoteDrawScope.() -> Unit,
    )
```

Executes `drawBlock` with the specified transformation applied.

#### Parameters

| | |
| --- | --- |
| transformBlock | The block defining the transformations to apply. |
| drawBlock | The block containing drawing operations to execute with the transformations applied. |

<hr class="docs-overload-divider">

<h2 id="drawtextoncircle-text-centerx-centery-radius-startangle-warpradiusoffset-paint">drawTextOnCircle</h2>

```kotlin
public fun drawTextOnCircle(
        text: RemoteString,
        centerX: RemoteFloat,
        centerY: RemoteFloat,
        radius: RemoteFloat,
        startAngle: RemoteFloat,
        warpRadiusOffset: RemoteFloat,
        paint: RemotePaint? = null,
    )
```

Draws text along a circle.

#### Parameters

| | |
| --- | --- |
| text | The text to draw. |
| centerX | The x-coordinate of the circle's center. |
| centerY | The y-coordinate of the circle's center. |
| radius | The radius of the circle. |
| startAngle | The starting angle for the text. |
| warpRadiusOffset | the offset of the text from the circle. |
| paint | The [RemotePaint](/jetpack-compose/androidx.compose.remote/remote-creation-compose/interfaces/RemotePaint) to use for drawing. |

<hr class="docs-overload-divider">

<h2 id="cliprect-left-top-right-bottom-clipop-block">clipRect</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun clipRect(
        left: RemoteFloat,
        top: RemoteFloat,
        right: RemoteFloat,
        bottom: RemoteFloat,
        clipOp: ClipOp = ClipOp.Intersect,
        block: RemoteDrawScope.() -> Unit,
    )
```

Clips the drawing area to the specified rectangle and executes `block` within it.

<hr class="docs-overload-divider">

<h2 id="clippath-path-clipop-block">clipPath</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun clipPath(
        path: RemotePath,
        clipOp: ClipOp = ClipOp.Intersect,
        block: RemoteDrawScope.() -> Unit,
    )
```

Clips the drawing area to the specified [path](/jetpack-compose/androidx.compose.remote/remote-creation-compose/functions/path) and executes `block` within it.

<hr class="docs-overload-divider">

<h2 id="drawconditionally-condition-body">drawConditionally</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawConditionally(condition: RemoteBoolean, body: RemoteDrawScope.() -> Unit)
```

Executes `body` if `condition` evaluates to true.

<hr class="docs-overload-divider">

<h2 id="drawtooffscreenbitmap-bitmap-body">drawToOffscreenBitmap</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun drawToOffscreenBitmap(bitmap: RemoteBitmap, body: RemoteDrawScope.() -> Unit)
```

Draws into an offscreen bitmap and executes `body`.

<hr class="docs-overload-divider">

<h2 id="loop-from-until-step-body">loop</h2>

```kotlin
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun loop(
        from: RemoteFloat,
        until: RemoteFloat,
        step: RemoteFloat,
        body: RemoteDrawScope.(index: RemoteFloat) -> Unit,
    )
```

Executes `body` commands in a loop.