Platforms to show: All Mac Windows Linux Cross-Platform

Back to DirectDrawGraphicsMBS class.

DirectDrawGraphicsMBS.ClearStrokeStyle

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Clears stroke style.

If no stroke style is defined, a default one is used.

DirectDrawGraphicsMBS.Constructor(Graphics as Graphics)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The constructor.
Example
dim p as new Picture(200,200)
dim g as Graphics = p.Graphics
// Clear image with white
g.DrawingColor = &cFFFFFF
g.FillRectangle 0, 0, g.Width, g.Height

dim d as new DirectDrawGraphicsMBS(g)

call d.CreateSolidColorBrush(&cFF0000)
d.DrawLine 10, 10, 190,190

Backdrop = p

Pass the graphics in a paint event or from a picture.

Requires Xojo 2019r2 or newer.

DirectDrawGraphicsMBS.CreateSolidColorBrush(c as Color) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates a new solid color brush that has the specified color and a base opacity of 1.0.
Example
dim d as new DirectDrawGraphicsMBS(g)

// make full blue with no alpha
call d.CreateSolidColorBrush(&c0000FFFF)

Pass the red, green, blue, and alpha values of the brush's color as a Xojo color.

See also:

Some examples using this method:

DirectDrawGraphicsMBS.CreateSolidColorBrush(red as Single, green as Single, blue as Single, alpha as Single = 1.0) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates a new solid color brush that has the specified color and a base opacity of 1.0.

Pass the red, green, blue, and alpha values of the brush's color.
Range of values is from 0.0 to 1.0.

See also:

DirectDrawGraphicsMBS.CreateStrokeStyle(startCap as Integer = 0, endCap as Integer = 0, dashCap as Integer = 0, lineJoin as Integer = 0, miterLimit as Single = 1.0, dashStyle as Integer = 0, dashOffset as Single = 0, Dashes() as Single = nil) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Creates an stroke style that describes start cap, dash pattern, and other features of a stroke.

Creates and sets the stroke style. Returns true on success and false on failure.

startCapThe cap applied to the start of all the open figures in a stroked geometry.
endCapThe cap applied to the end of all the open figures in a stroked geometry.
dashCapThe shape at either end of each dash segment.
lineJoinA value that describes how segments are joined. This value is ignored for a vertex if the segment flags specify that the segment should have a smooth join.
miterLimitThe limit of the thickness of the join on a mitered corner. This value is always treated as though it is greater than or equal to 1.0.
dashStyleA value that specifies whether the stroke has a dash pattern and, if so, the dash style.
dashOffsetA value that specifies an offset in the dash sequence. A positive dash offset value shifts the dash pattern, in units of stroke width, toward the start of the stroked geometry. A negative dash offset value shifts the dash pattern, in units of stroke width, toward the end of the stroked geometry.
DashesAn array whose elements are set to the length of each dash and space in the dash pattern. The first element sets the length of a dash, the second element sets the length of a space, the third element sets the length of a dash, and so on. The length of each dash and space in the dash pattern is the product of the element value in the array and the stroke width.

Some examples using this method:

DirectDrawGraphicsMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The destructor.

DirectDrawGraphicsMBS.DrawEllipse(x as single, y as single, radiusX as single, radiusY as single)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Draws the outline of the specified ellipse using the specified stroke style.
Example
dim p as new Picture(200,200)
dim g as Graphics = p.Graphics
// Clear image with white
g.DrawingColor = &cFFFFFF
g.FillRectangle 0, 0, g.Width, g.Height

dim d as new DirectDrawGraphicsMBS(g)

call d.CreateSolidColorBrush(&cFF0000)
call d.CreateStrokeStyle 0, 0, 0, 0, 0, d.DashStyleDash
d.DrawEllipse 100, 100, 90, 90

Backdrop = p

x/y: The position of the ellipse to draw, in device-independent pixels.
radiusX/radiusY: The radius of the ellipse to draw, in device-independent pixels.

Uses current brush, strokeWidth and strokeStyle.

DirectDrawGraphicsMBS.DrawLine(x1 as single, y1 as single, x2 as single, y2 as single)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Draws a line between the specified points using the specified stroke style.
Example
dim p as new Picture(200,200)
dim g as Graphics = p.Graphics
// Clear image with white
g.DrawingColor = &cFFFFFF
g.FillRectangle 0, 0, g.Width, g.Height

dim d as new DirectDrawGraphicsMBS(g)

call d.CreateSolidColorBrush(&cFF0000)
d.DrawLine 10, 10, 190,190

Backdrop = p

x1/y1: The start point of the line, in device-independent pixels.
x2/y2: The end point of the line, in device-independent pixels.

Uses current brush, strokeWidth and strokeStyle.

DirectDrawGraphicsMBS.DrawRectangle(left as single, top as single, right as single, bottom as single)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Draws the outline of a rectangle that has the specified dimensions and stroke style.
Example
dim p as new Picture(200,200)
dim g as Graphics = p.Graphics
// Clear image with white
g.DrawingColor = &cFFFFFF
g.FillRectangle 0, 0, g.Width, g.Height

dim d as new DirectDrawGraphicsMBS(g)

call d.CreateSolidColorBrush(&cFF0000)
call d.CreateStrokeStyle 0, 0, 0, 0, 0, d.DashStyleDash
d.DrawRectangle 10, 10, 190, 190

Backdrop = p

Pass the dimensions of the rectangle to draw, in device-independent pixels.

Uses current brush, strokeWidth and strokeStyle.

DirectDrawGraphicsMBS.DrawRoundedRectangle(left as single, top as single, right as single, bottom as single, radiusX as single, radiusY as single)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Draws the outline of the specified rounded rectangle using the specified stroke style.
Example
dim p as new Picture(200,200)
dim g as Graphics = p.Graphics
// Clear image with white
g.DrawingColor = &cFFFFFF
g.FillRectangle 0, 0, g.Width, g.Height

dim d as new DirectDrawGraphicsMBS(g)

call d.CreateSolidColorBrush(&cFF0000)
call d.CreateStrokeStyle 0, 0, 0, 0, 0, d.DashStyleDash
d.DrawRoundedRectangle 10, 10, 190, 190, 20, 20

Backdrop = p

Pass the dimensions of the rounded rectangle to draw, in device-independent pixels.

Uses current brush, strokeWidth and strokeStyle.

DirectDrawGraphicsMBS.FillEllipse(x as single, y as single, radiusX as single, radiusY as single)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Paints the interior of the specified ellipse.
Example
dim p as new Picture(200,200)
dim g as Graphics = p.Graphics
// Clear image with white
g.DrawingColor = &cFFFFFF
g.FillRectangle 0, 0, g.Width, g.Height

dim d as new DirectDrawGraphicsMBS(g)

call d.CreateSolidColorBrush(&cFF0000)

d.FillEllipse 100, 100, 90, 90

Backdrop = p

The position and radius, in device-independent pixels, of the ellipse to paint.
Uses current brush.

DirectDrawGraphicsMBS.FillRectangle(left as single, top as single, right as single, bottom as single)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Paints the interior of the specified rectangle.
Example
dim p as new Picture(200,200)
dim g as Graphics = p.Graphics
// Clear image with white
g.DrawingColor = &cFFFFFF
g.FillRectangle 0, 0, g.Width, g.Height

dim d as new DirectDrawGraphicsMBS(g)

call d.CreateSolidColorBrush(&cFF0000)

d.FillRectangle 10, 10, 190, 190

Backdrop = p

The dimension of the rectangle to paint, in device-independent pixels.
Uses current brush.

DirectDrawGraphicsMBS.FillRoundedRectangle(left as single, top as single, right as single, bottom as single, radiusX as single, radiusY as single)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Paints the interior of the specified rounded rectangle.
Example
dim p as new Picture(200,200)
dim g as Graphics = p.Graphics
// Clear image with white
g.DrawingColor = &cFFFFFF
g.FillRectangle 0, 0, g.Width, g.Height

dim d as new DirectDrawGraphicsMBS(g)

call d.CreateSolidColorBrush(&cFF0000)

d.FillRoundedRectangle 10, 10, 190, 190, 20, 20

Backdrop = p

The dimensions of the rounded rectangle to paint, in device independent pixels.
Uses current brush.

DirectDrawGraphicsMBS.GetTransform(byref m11 as Single, byref m12 as Single, byref m21 as Single, byref m22 as Single, byref dx as Single, byref dy as Single)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Gets the current transform of the render target.

DirectDrawGraphicsMBS.RestoreDrawingState

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Restores the current drawing state.

Our plugin manages the stack of drawing states saved.
We raise an exception if your calls to restore are not balanced with save.

DirectDrawGraphicsMBS.SaveDrawingState

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Saves the current drawing state.

Our plugin manages the stack of drawing states saved, so you can restore them later.

DirectDrawGraphicsMBS.SetTransform(m11 as Single, m12 as Single, m21 as Single, m22 as Single, dx as Single, dy as Single)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
Applies the specified transform to the render target, replacing the existing transformation.

All subsequent drawing operations occur in the transformed space.

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


The biggest plugin in space...