Platforms to show: All Mac Windows Linux Cross-Platform

Back to Picture class.

Picture.ScaleMBS(width as Integer, height as Integer, AntiAlias as boolean=false, YieldTicks as Integer=0) as picture

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Graphics & Pictures MBS Picture Plugin 5.1 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Scales the picture to the new size.
Example
dim pic as new Picture(100,100,32)

pic.Graphics.ForeColor=&cFF0000
pic.Graphics.FillOval 0,0,100,100

dim scaledPic as picture = pic.ScaleMBS(200,200)

// show scaledPic
window1.backdrop = scaledPic

This is a self made algorithm which produces nice pictures on all platforms.
It is slower than QuickDraw on Mac OS, but nicer than drawpicture on Windows.
Returns nil on low memory or invalid width and height values.

AntiAlias is set to false if width<=self.width or height<=self.height.

If YieldTicks is 0, no time is given to other threads in your application. If it is a value > 0, this time is waited before a thread switch is done. Setting it to 1 will give away control to another thread after 1/60th of a second. We recommend a value of 3 to 5 for a good reponsibility of your application.

Scaling down does not use antialias. If you need full antialias, please use ScalingMBS function.

If input and output size is equal, you get your picture back unchanged.
This function does not handle masks. Please use pictures with mask and scale image and mask separately.

Version 19.4 or newer of our plugin includes scaling for pictures with alpha channel.

Some examples using this method:

Blog Entries

The items on this page are in the following plugins: MBS Picture Plugin.


The biggest plugin in space...