DirectDrawGraphicsMBS 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

DirectDrawGraphicsMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Windows MBS Win Plugin 20.3 ❌ No ✅ Yes ❌ No ❌ No Desktop, Console & Web
The class for drawing with DirectDraw 2D into a graphics context in Xojo.
Example
dim p as Picture = BitmapForCaching(me.Width, me.Height)
dim g as graphics = p.Graphics

// Clear image with white
g.DrawingColor = &cFFFFFF
g.FillRectangle 0, 0, g.Width, g.Height

// now draw a few things
dim d as new DirectDrawGraphicsMBS(g)

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

const size = 50
const offset = 10
const delta = offset + size

d.FillRectangle offset + delta * 0, offset + 0 * delta, offset + delta * 0 + size, offset + 0 * delta + size
d.DrawRectangle offset + delta * 0, offset + 1 * delta, offset + delta * 0 + size, offset + 1 * delta + size

d.FillEllipse offset + delta * 1 + size/2, offset + 0 * delta + size/2, size /2, size /2
d.DrawEllipse offset + delta * 1 + size/2, offset + 1 * delta + size/2, size /2, size /2

d.FillRoundedRectangle offset + delta * 2, offset + 0 * delta, offset + delta * 2 + size, offset + 0 * delta + size, 20, 20
d.DrawRoundedRectangle offset + delta * 2, offset + 1 * delta, offset + delta * 2 + size, offset + 1 * delta + size, 20, 20

// save to desktop
dim f as FolderItem = SpecialFolder.Desktop.Child("directdraw.jpg")
p.Save(f, Picture.Formats.JPEG, picture.QualityMaximum)

// show in window
window1.Backdrop = p

Anti Alias Modes

Constant Value Description
AntiAliasModeAliased 1 Objects are aliased in most cases. Objects are antialiased only when they are drawn to a render target created by the CreateDxgiSurfaceRenderTarget method and Direct3D multisampling has been enabled on the backing DirectX Graphics Infrastructure (DXGI) surface.
AntiAliasModePerPrimitive 0 Edges are antialiased using the Direct2D per-primitive method of high-quality antialiasing.

Cap Styles

Constant Value Description
CapStyleFlat 0 A cap that does not extend past the last point of the line. Comparable to cap used for objects other than lines.
CapStyleRound 0 A semicircle that has a diameter equal to the line thickness.
CapStyleSquare 0 Half of a square that has a length equal to the line thickness.
CapStyleTriangle 0 An isosceles right triangle whose hypotenuse is equal in length to the thickness of the line.

Dash Styles

Constant Value Description
DashStyleCustom 5 The dash pattern is specified by an array of floating-point values.
DashStyleDash 1 A dash followed by a gap of equal length. The dash and the gap are each twice as long as the stroke thickness. The equivalent dash array for D2D1_DASH_STYLE_DASH is {2, 2}.
DashStyleDashDot 3 A dash, followed by a gap, followed by a dot, followed by another gap. The equivalent dash array for D2D1_DASH_STYLE_DASH_DOT is {2, 2, 0, 2}.
DashStyleDashDotDot 4 A dash, followed by a gap, followed by a dot, followed by another gap, followed by another dot, followed by another gap. The equivalent dash array for D2D1_DASH_STYLE_DASH_DOT_DOT is {2, 2, 0, 2, 0, 2}.
DashStyleDot 2 A dot followed by a longer gap. The equivalent dash array for D2D1_DASH_STYLE_DOT is {0, 2}.
DashStyleSolid 0 A solid line with no breaks.

Line Join

Constant Value Description
LineJoinBevel 1 Beveled vertices.
LineJoinMiter 0 Regular angular vertices.
LineJoinMiterOrBevel 3 Regular angular vertices unless the join would extend beyond the miter limit; otherwise, beveled vertices.
LineJoinRound 2 Rounded vertices.

Text Anti Alias Modes

Constant Value Description
TextAntiAliasModeAliased 1 Do not use antialiasing.
TextAntiAliasModeClearType 1 Use ClearType antialiasing.
TextAntiAliasModeDefault 0 Use the system default. See Remarks.
TextAntiAliasModeGrayscale 1 Use grayscale antialiasing.

This class has no sub classes.

Some examples using this class:

Blog Entries

Release notes


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


DigestMBS   -   DirectorySizeMBS


💬 Ask a question or report a problem