---
title: "drawOSC(withWidth:height:activePart:destinationImage:at:)"
framework: Professional Video Applications
role: symbol
role_heading: Instance Method
platforms: [fxplug 4.0+]
path: "professional_video_applications/fxonscreencontrol_v4/drawosc(withwidth:height:activepart:destinationimage:at:)"
---

# drawOSC(withWidth:height:activePart:destinationImage:at:)

Draws a control on an image. This is the main method the host application calls to draw a plug-in parameter control.

## Declaration

```swift
func drawOSC(withWidth width: Int, height: Int, activePart: Int, destinationImage: FxImageTile!, at time: CMTime)
```

## Parameters

- `width`: Width of the current image where the control will be drawn.
- `height`: Height of the current image where the control will be drawn.
- `activePart`: The active part of the control to draw.
- `destinationImage`: An doc://com.apple.professionalvideoapplications/documentation/professional_video_applications/FxImageTile/ioSurface into which you should draw your OSCs.
- `time`: The time at which to draw the control.

## Discussion

Discussion This method is called when the host application wants you to draw your onscreen controls. You should draw them into the destination image. The activePart parameter tells which part of the control is currently selected so you can draw that control with proper highlighting.

## See Also

### Instance Methods

- [drawingCoordinates()](professional_video_applications/fxonscreencontrol_v4/drawingcoordinates().md)
- [hitTestOSC(atMousePositionX:mousePositionY:activePart:at:)](professional_video_applications/fxonscreencontrol_v4/hittestosc(atmousepositionx:mousepositiony:activepart:at:).md)
- [keyDown(atPositionX:positionY:keyPressed:modifiers:forceUpdate:didHandle:at:)](professional_video_applications/fxonscreencontrol_v4/keydown(atpositionx:positiony:keypressed:modifiers:forceupdate:didhandle:at:).md)
- [keyUp(atPositionX:positionY:keyPressed:modifiers:forceUpdate:didHandle:at:)](professional_video_applications/fxonscreencontrol_v4/keyup(atpositionx:positiony:keypressed:modifiers:forceupdate:didhandle:at:).md)
- [mouseDown(atPositionX:positionY:activePart:modifiers:forceUpdate:at:)](professional_video_applications/fxonscreencontrol_v4/mousedown(atpositionx:positiony:activepart:modifiers:forceupdate:at:).md)
- [mouseDragged(atPositionX:positionY:activePart:modifiers:forceUpdate:at:)](professional_video_applications/fxonscreencontrol_v4/mousedragged(atpositionx:positiony:activepart:modifiers:forceupdate:at:).md)
- [mouseEntered(atPositionX:positionY:modifiers:forceUpdate:at:)](professional_video_applications/fxonscreencontrol_v4/mouseentered(atpositionx:positiony:modifiers:forceupdate:at:).md)
- [mouseExited(atPositionX:positionY:modifiers:forceUpdate:at:)](professional_video_applications/fxonscreencontrol_v4/mouseexited(atpositionx:positiony:modifiers:forceupdate:at:).md)
- [mouseMoved(atPositionX:positionY:activePart:modifiers:forceUpdate:at:)](professional_video_applications/fxonscreencontrol_v4/mousemoved(atpositionx:positiony:activepart:modifiers:forceupdate:at:).md)
- [mouseUp(atPositionX:positionY:activePart:modifiers:forceUpdate:at:)](professional_video_applications/fxonscreencontrol_v4/mouseup(atpositionx:positiony:activepart:modifiers:forceupdate:at:).md)
