PictureWriterMBS class

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

PictureWriterMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Graphics & Pictures MBS Picture Plugin 6.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
A class to build a picture by filling a memoryblock.
Example
dim p as PictureWriterMBS
dim m as MemoryBlock
dim r,g,b,rRow,gRow,bRow,h1,w1,x,y,bpp as Integer

// Create a new picture writer
p=NewPictureWriterMBS(512,512)

h1=p.Height-1
w1=p.Width-1

bpp=p.BytesPerPixel
rRow=p.RedOffset
gRow=p.GreenOffset
bRow=p.BlueOffset
// in each row the red, blue and green channels have different offsets.
// but offsets are platform dependend

for y=0 to h1
// Get data in memory. This Memoryblock has a size property of 0!
m=p.Data(y)
r=rRow
g=gRow
b=bRow

for x=0 to w1

m.UInt8Value(r)=x\2
m.UInt8Value(g)=y\2
m.UInt8Value(b)=x*y\2

r=r+bpp
g=g+bpp
b=b+bpp
next

next

// Use Render to make a picture object
dim pic as Picture = p.Render
Backdrop = pic

This is the same code the plugin uses to create pictures.

This class has no sub classes.

Some useful global functions for this class:

Some examples using this class:

Blog Entries


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


PictureSepiaMBS   -   PKeyMBS


💬 Ask a question or report a problem