# SetClipOrigin

Sets the clip origin of a bitmap.

### Synopsis

`Err SetClipOrigin (Item bitmapItem,int32 x,int32 y)`

### Description

This call sets the clip origin of a bitmap. Specify the item number of a bitmap and the x and y coordinates of the top-left corner of the clip rectangle within the bitmap.

The (0,0) coordinate always refers to the top-left corner of the clip window, whether the clip window is set to the full size of the bitmap or to some subregion of the bitmap. The clip rectangle that you specify must fit within the parameters of the bitmap; that is, the clip x offset plus the clip window width must not exceed the actual width of the bitmap. The same is true for the height, or y, offset. The order of operations setting width/height first or setting origin first is significant.

If the read address is the same as the write address (this is normal), then the read buffer address is modified the same as the write buffer address (this is what you would expect). If you use `SetReadAddress()` to set the read address to something other than the write buffer, the read address is not disturbed by the call to `SetClipOrigin()`.

### Arguments

bitmapItem
  Item number of a Bitmap structure.

x
  Value for the top-left corner x coordinate.

y
  Value for the top-left corner y coordinate (At this time, if the y argument is an odd number, it is forced to the next numerically lower even number, and a warning is returned.)

### Return Value

The call returns 0 if successful or an error code (a negative value) if an error occurs.

### Implementation

Folio call implemented in Graphics folio V20.

### Associated Files

graphics.h, graphics.lib

### See Also

``SetClipWidth`(),SetClipHeight()`