Platforms to show: All Mac Windows Linux Cross-Platform

BitRotateMBS(Degree as Integer, InputData as Ptr, OutputData as Ptr, Width as Integer, Height as Integer, InputRowBytes as Integer = -1, OutputRowBytes as Integer = -1) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
global method Pictures Import and Export MBS Images Plugin 18.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Rotates 1bit image in memory.
Example

Dim InputTIFF As TiffPictureMBS // your input file
Dim OutputTIFF as TiffPictureMBS // your output file

Dim inMB As MemoryBlock = InputTIFF.Scanlines(0, InputTIFF.Height)
Dim outMB As New MemoryBlock(OutputTIFF.BytesPerRow * (OutputTIFF.Height + 8))

Const PlateRotation = 90

Dim b As Boolean = BitRotateMBS(PlateRotation, inMB, outMB, InputTIFF.Width, InputTIFF.Height, InputTIFF.BytesPerRow, OutputTIFF.BytesPerRow)

Break

Degree can be -360, -270, -180, -90, 0, 90, 180 or 270 to rotate counter clockwise.
InputData points to an 1bit image with given width and height. InputRowBytes if defined tells how many bytes per row are used in the input image. If <= 0, we calculate it. OutputRowBytes defines row bytes for output image, which is different for 90/270 rotation.
Returns true on success or false on failure.
The function is optimized for 180 degree to be quicker if image size is multiply of 8.
For 90 and 270 degree, there is an optimization if width and height are a multiply of 8.

Some examples using this global method:

Blog Entries

Xojo Developer Magazine

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


The biggest plugin in space...