Image.Stretch() now takes a third optional argument to stretch without antialiasing.

[GB.GTK]
* NEW: Image.Stretch() now takes a third optional argument to stretch without antialiasing.

[GB.GTK3]
* NEW: Image.Stretch() now takes a third optional argument to stretch without antialiasing.

[GB.QT4]
* NEW: Image.Stretch() now takes a third optional argument to stretch without antialiasing.

[GB.QT5]
* NEW: Image.Stretch() now takes a third optional argument to stretch without antialiasing.
This commit is contained in:
gambas 2022-02-25 20:30:55 +01:00
parent cdcdd03848
commit d7b5486d85
2 changed files with 6 additions and 6 deletions

View file

@ -211,12 +211,12 @@ BEGIN_METHOD(Image_Save, GB_STRING path; GB_INTEGER quality)
END_METHOD
BEGIN_METHOD(Image_Stretch, GB_INTEGER width; GB_INTEGER height)
BEGIN_METHOD(Image_Stretch, GB_INTEGER width; GB_INTEGER height; GB_BOOLEAN fast)
CIMAGE *img;
check_image(THIS);
img = CIMAGE_create(PICTURE->stretch(VARG(width), VARG(height), true));
img = CIMAGE_create(PICTURE->stretch(VARG(width), VARG(height), !VARGOPT(fast, FALSE)));
GB.ReturnObject((void*)img);
END_METHOD
@ -276,7 +276,7 @@ GB_DESC CImageDesc[] =
GB_STATIC_METHOD("FromString", "Image", Image_FromString, "(Data)s"),
GB_METHOD("Save", 0, Image_Save, "(Path)s[(Quality)i]"),
GB_METHOD("Stretch", "Image", Image_Stretch, "(Width)i(Height)i"),
GB_METHOD("Stretch", "Image", Image_Stretch, "(Width)i(Height)i[(Fast)b]"),
GB_METHOD("Rotate", "Image", Image_Rotate, "(Angle)f"),
GB_METHOD("PaintImage", 0, Image_PaintImage, "(Image)Image;(X)i(Y)i[(Width)i(Height)i(SrcX)i(SrcY)i(SrcWidth)i(SrcHeight)i]"),

View file

@ -217,7 +217,7 @@ BEGIN_METHOD(Image_Save, GB_STRING path; GB_INTEGER quality)
END_METHOD
BEGIN_METHOD(Image_Stretch, GB_INTEGER width; GB_INTEGER height)
BEGIN_METHOD(Image_Stretch, GB_INTEGER width; GB_INTEGER height; GB_BOOLEAN fast)
//static int count = 0;
QImage *stretch;
@ -239,7 +239,7 @@ BEGIN_METHOD(Image_Stretch, GB_INTEGER width; GB_INTEGER height)
if (w > 0 && h > 0)
{
*stretch = QIMAGE->scaled(w, h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
*stretch = QIMAGE->scaled(w, h, Qt::IgnoreAspectRatio, VARGOPT(fast, FALSE) ? Qt::FastTransformation : Qt::SmoothTransformation);
stretch->detach();
}
}
@ -333,7 +333,7 @@ GB_DESC CImageDesc[] =
GB_STATIC_METHOD("FromString", "Image", Image_FromString, "(Data)s"),
GB_METHOD("Save", NULL, Image_Save, "(Path)s[(Quality)i]"),
GB_METHOD("Stretch", "Image", Image_Stretch, "(Width)i(Height)i"),
GB_METHOD("Stretch", "Image", Image_Stretch, "(Width)i(Height)i[(Fast)b]"),
GB_METHOD("Rotate", "Image", Image_Rotate, "(Angle)f"),
GB_METHOD("PaintImage", NULL, Image_PaintImage, "(Image)Image;(X)i(Y)i[(Width)i(Height)i(SrcX)i(SrcY)i(SrcWidth)i(SrcHeight)i]"),