This documentation is for the free plugin Py4D in CINEMA 4D R11.5 and not for the C4DSDK of Python in CINEMA 4D R12. For R12, please visit PluginCafe.com
This class stores and manipulates a bitmap, providing more advanced drawing tools than BaseBitmap. Just like for bitmaps x = y = 0 is the top left corner. Be sure to call GeClipMap.Init(), GeClipMap.InitFrom() or GeClipMap.InitWith() before you attempt to use a newly allocated clip map.
Note
Though clip maps support other bit depths than 32, the functionality is severly limited. It is recommended that the clip map class is only used for 32 bit bitmaps. (Please note that the default bit depth for BaseBitmap is 24. You need to manually set it to 32 if you use Init>() to initialize the clip map.)
Creates a new instance of GeClipMap.
| Return type: | GeClipMap |
|---|---|
| Returns: | The new clipmap. |
Initializes the clip map bitmap to the given dimensions and depth. Any previous data is lost.
| Parameters: |
|
|---|---|
| Return type: | bool |
| Returns: | True if the initialization was successfull. |
Loads the clip map bitmap from bm. Any previous data is lost.
| Parameter: | bm (BaseBitmap) – The bitmap to initalize the clip map with. |
|---|---|
| Return type: | bool |
| Returns: | True if the clip map was initialized, otherwise False. |
Loads the clip map bitmap from bm. Any previous data is lost.
| Parameters: |
|
|---|---|
| Return type: | bool |
| Returns: | True if the clip map was initialized, otherwise False. |
Returns a reference to the internal bitmap.
| Return type: | BaseBitmap |
|---|---|
| Returns: | The bitmap. |
Retrieves the pixel dimensions of the clip map:
x, y = clmap.GetDim()
Retrieves the pixel width of the clip map.
| Return type: | int |
|---|---|
| Returns: | The width. |
Retrieves the pixel height of the clip map.
| Return type: | int |
|---|---|
| Returns: | The height. |
Returns the internal bitmap.
Note
The clip map alpha channel won’t be encoded in this bitmap. This is a limitation.
| Return type: | BaseBitmap |
|---|---|
| Returns: | The internal bitmap. |
Checks if the draw operation mode is initialized.
Note
Call begin_draw before
| Parameters: |
|
|---|
Offsets all the following draw commands by this amount.
Note
The clip region isn’t offset.
| Parameters: |
|
|---|
Sets the draw mode for the following drawing operations.
Note
Call draw_init before
| Parameters: |
|
|---|
Sets the pixel at (x,y) to the draw color.
| Parameters: |
|
|---|
Draws a line from (x1,y1) to (x2,y2) with the draw color.
| Parameters: |
|
|---|
Draws the outline of a rectangle from (x1,y1) to (x2,y2) with the draw color.
| Parameters: |
|
|---|
Fills a rectangle from (x1,y1) to (x2,y2) with the draw color.
| Parameters: |
|
|---|
Fills a rectangle from (x1,y1) to (x2,y2) with the draw color.
| Parameters: |
|
|---|
Draws an arc within the rectangle from (x1,y1) to (x2,y2) with the draw color.
| Parameters: |
|
|---|
Draws an ellipse within the rectangle from (x1,y1) to (x2,y2) with the draw color.
| Parameters: |
|
|---|
Fills an ellipse within the rectangle from (x1,y1) to (x2,y2) with the draw color.
| Parameters: |
|
|---|
Sets the pixel at (x,y) to the specified color.
| Parameters: |
|
|---|
Retrieves the color of the pixel at (x,y):
r, g, b, a = clmap.GetPixelRGBA(5, 5)
| Parameters: |
|
|---|---|
| Return type: | list of int |
| Returns: | The color. |
Prints the string txt with the top left corner at (x,y) in the current draw color.
| Parameters: |
|
|---|
Calculates the width of the string txt in the current font.
| Parameter: | txt (str) – The string. |
|---|---|
| Return type: | int |
| Returns: | Calculates the maximum height of a string in the current font. |
Checks if a point is inside the clip region.
| Parameters: |
|
|---|---|
| Return type: | bool |
| Returns: | True if the point is inside the region, otherwise False. |
Checks if a rectangle is inside the clip region.
| Parameters: |
|
||||||
|---|---|---|---|---|---|---|---|
| Return type: | int |
||||||
| Returns: | The result:
|