Update RingRayLib - raylib.c - Add Function : void ImageResizeCanvas(Image *image, int newWidth, int newHeight, int offsetX, int offsetY, Color color)
@@ -3050,6 +3050,38 @@ RING_FUNC(ring_ImageResizeNN)
ImageResizeNN((Image *) RING_API_GETCPOINTER(1,"Image"), (int ) RING_API_GETNUMBER(2), (int ) RING_API_GETNUMBER(3));
}
+
+RING_FUNC(ring_ImageResizeCanvas)
+{
+ if ( RING_API_PARACOUNT != 6 ) {
+ RING_API_ERROR(RING_API_BADPARACOUNT);
+ return ;
+ }
+ if ( ! RING_API_ISPOINTER(1) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ if ( ! RING_API_ISNUMBER(2) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ if ( ! RING_API_ISNUMBER(3) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ if ( ! RING_API_ISNUMBER(4) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ if ( ! RING_API_ISNUMBER(5) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ ImageResizeCanvas((Image *) RING_API_GETCPOINTER(1,"Image"), (int ) RING_API_GETNUMBER(2), (int ) RING_API_GETNUMBER(3), (int ) RING_API_GETNUMBER(4), (int ) RING_API_GETNUMBER(5),* (Color *) RING_API_GETCPOINTER(6,"Color"));
+ if (RING_API_ISCPOINTERNOTASSIGNED(6))
+ ring_state_free(((VM *) pPointer)->pRingState,RING_API_GETCPOINTER(6,"Color"));
+}
+
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("initwindow",ring_InitWindow);
@@ -3242,4 +3274,5 @@ RING_API void ringlib_init(RingState *pRingState)
ring_vm_funcregister("imagecrop",ring_ImageCrop);
ring_vm_funcregister("imageresize",ring_ImageResize);
ring_vm_funcregister("imageresizenn",ring_ImageResizeNN);
+ ring_vm_funcregister("imageresizecanvas",ring_ImageResizeCanvas);
}
