Class Snapshot
- All Implemented Interfaces:
Proxy
RenderNodes for widgets.
It functions in a similar way to a cairo context, and maintains a stack of render nodes and their associated transformations.
The node at the top of the stack is the one that gtk_snapshot_append_…()
functions operate on. Use the gtk_snapshot_push_…() functions and
pop() to change the current node.
The typical way to obtain a GtkSnapshot object is as an argument to
the Widget.snapshot(org.gnome.gtk.Snapshot) vfunc. If you need to create your own
GtkSnapshot, use Snapshot().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSnapshot.Builder<B extends Snapshot.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classNested classes/interfaces inherited from class org.gnome.gdk.Snapshot
Snapshot.Snapshot$ImplNested classes/interfaces inherited from class org.gnome.gobject.GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionSnapshot()Creates a new Snapshot.Snapshot(MemorySegment address) Create a Snapshot proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoidappendBorder(RoundedRect outline, @org.jspecify.annotations.Nullable float @Nullable [] borderWidth, @Nullable RGBA @Nullable [] borderColor) Appends a stroked border rectangle inside the givenoutline.org.freedesktop.cairo.ContextappendCairo(Rect bounds) Creates a newCairoNodeand appends it to the current render node ofsnapshot,without changing the current node.voidappendColor(RGBA color, Rect bounds) Creates a new render node drawing thecolorinto the givenboundsand appends it to the current render node ofsnapshot.voidappendConicGradient(Rect bounds, Point center, float rotation, @Nullable ColorStop @Nullable [] stops) Appends a conic gradient node with the given stops tosnapshot.voidappendFill(Path path, FillRule fillRule, RGBA color) A convenience method to fill a path with a color.voidappendInsetShadow(RoundedRect outline, RGBA color, float dx, float dy, float spread, float blurRadius) Appends an inset shadow into the box given byoutline.voidappendLayout(Layout layout, RGBA color) Creates render nodes for renderinglayoutin the given foregoundcolorand appends them to the current node of this Snapshot without changing the current node.voidappendLinearGradient(Rect bounds, Point startPoint, Point endPoint, @Nullable ColorStop @Nullable [] stops) Appends a linear gradient node with the given stops tosnapshot.voidappendNode(RenderNode node) Appendsnodeto the current render node ofsnapshot,without changing the current node.voidappendOutsetShadow(RoundedRect outline, RGBA color, float dx, float dy, float spread, float blurRadius) Appends an outset shadow node around the box given byoutline.voidappendRadialGradient(Rect bounds, Point center, float hradius, float vradius, float start, float end, @Nullable ColorStop @Nullable [] stops) Appends a radial gradient node with the given stops tosnapshot.voidappendRepeatingLinearGradient(Rect bounds, Point startPoint, Point endPoint, @Nullable ColorStop @Nullable [] stops) Appends a repeating linear gradient node with the given stops tosnapshot.voidappendRepeatingRadialGradient(Rect bounds, Point center, float hradius, float vradius, float start, float end, @Nullable ColorStop @Nullable [] stops) Appends a repeating radial gradient node with the given stops tosnapshot.voidappendScaledTexture(Texture texture, ScalingFilter filter, Rect bounds) Creates a new render node drawing thetextureinto the givenboundsand appends it to the current render node ofsnapshot.voidappendStroke(Path path, Stroke stroke, RGBA color) A convenience method to stroke a path with a color.voidappendTexture(Texture texture, Rect bounds) Creates a new render node drawing thetextureinto the givenboundsand appends it to the current render node ofsnapshot.protected SnapshotasParent()Returns this instance as if it were its parent type.static Snapshot.Builder<? extends Snapshot.Builder> builder()ASnapshot.Builderobject constructs aSnapshotwith the specified properties.@Nullable RenderNodeReturns the node that was constructed by this Snapshot and freessnapshot.@Nullable PaintablefreeToPaintable(@Nullable Size size) Returns a paintable for the node that was constructed by this Snapshot and freessnapshot.static @Nullable TypegetType()Get the GType of the Snapshot classvoidDeprecated.GTK's new Vulkan-focused rendering does not support this feature.voidperspective(float depth) Applies a perspective projection transform.voidpop()Removes the top element from the stack of render nodes, and appends it to the node underneath it.voidBlends together two images with the given blend mode.voidpushBlur(double radius) Blurs an image.voidClips an image to a rectangle.voidpushColorMatrix(Matrix colorMatrix, Vec4 colorOffset) Modifies the colors of an image by applying an affine transformation in RGB space.voidpushComponentTransfer(ComponentTransfer red, ComponentTransfer green, ComponentTransfer blue, ComponentTransfer alpha) Modifies the colors of an image by applying a transfer function for each component.voidpushCrossFade(double progress) Snapshots a cross-fade operation between two images with the givenprogress.voidInserts a debug node with a message.voidFills the area given bypathandfillRulewith an image and discards everything outside of it.voidpushGlShader(GLShader shader, Rect bounds, byte[] takeArgs) Deprecated.GTK's new Vulkan-focused rendering does not support this feature.voidUntil the first call topop(), the mask image for the mask operation will be recorded.voidpushOpacity(double opacity) Modifies the opacity of an image.voidpushRepeat(Rect bounds, @Nullable Rect childBounds) Creates a node that repeats the child node.voidpushRoundedClip(RoundedRect bounds) Clips an image to a rounded rectangle.voidpushShadow(@Nullable Shadow @Nullable [] shadow) Applies a shadow to an image.voidpushStroke(Path path, Stroke stroke) Strokes the givenpathwith the attributes given bystrokeand an image.voidrenderBackground(StyleContext context, double x, double y, double width, double height) Deprecated.voidrenderFocus(StyleContext context, double x, double y, double width, double height) Deprecated.voidrenderFrame(StyleContext context, double x, double y, double width, double height) Deprecated.voidrenderInsertionCursor(StyleContext context, double x, double y, Layout layout, int index, Direction direction) Deprecated.voidrenderLayout(StyleContext context, double x, double y, Layout layout) Deprecated.voidrestore()Restores this Snapshot to the state saved by a preceding call tosave()and removes that state from the stack of saved states.voidrotate(float angle) Rotatessnapshot'scoordinate system byangledegrees in 2D space - or in 3D speak, rotates around the Z axis.voidRotatessnapshot'scoordinate system byangledegrees aroundaxis.voidsave()Makes a copy of the current state of this Snapshot and saves it on an internal stack.voidscale(float factorX, float factorY) Scalessnapshot'scoordinate system in 2-dimensional space by the given factors.voidscale3d(float factorX, float factorY, float factorZ) Scalessnapshot'scoordinate system by the given factors.@Nullable RenderNodetoNode()Returns the render node that was constructed bysnapshot.@Nullable PaintabletoPaintable(@Nullable Size size) Returns a paintable encapsulating the render node that was constructed bysnapshot.voidTransformssnapshot'scoordinate system with the giventransform.voidtransformMatrix(Matrix matrix) Transformssnapshot'scoordinate system with the givenmatrix.voidTranslatessnapshot'scoordinate system bypointin 2-dimensional space.voidtranslate3d(Point3D point) Translatessnapshot'scoordinate system bypoint.Methods inherited from class org.gnome.gobject.GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getMemoryLayout, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class org.gnome.gobject.TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Snapshot
Create a Snapshot proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
Snapshot
public Snapshot()Creates a new Snapshot.
-
-
Method Details
-
getType
-
asParent
Returns this instance as if it were its parent type. This is mostly synonymous to the Javasuperkeyword, but will set the native typeclass function pointers to the parent type. When overriding a native virtual method in Java, "chaining up" withsuper.methodName()doesn't work, because it invokes the overridden function pointer again. To chain up, callasParent().methodName(). This will call the native function pointer of this virtual method in the typeclass of the parent type. -
appendBorder
public void appendBorder(RoundedRect outline, @org.jspecify.annotations.Nullable float @Nullable [] borderWidth, @Nullable RGBA @Nullable [] borderColor) Appends a stroked border rectangle inside the givenoutline.The four sides of the border can have different widths and colors.
- Parameters:
outline- the outline of the borderborderWidth- the stroke width of the border on the top, right, bottom and left side respectively.borderColor- the color used on the top, right, bottom and left side.- Throws:
IllegalArgumentException- when length ofborderWidthis less than 4IllegalArgumentException- when length ofborderColoris less than 4
-
appendCairo
Creates a newCairoNodeand appends it to the current render node ofsnapshot,without changing the current node.- Parameters:
bounds- the bounds for the new node- Returns:
- a
cairo_tsuitable for drawing the contents of the newly created render node
-
appendColor
Creates a new render node drawing thecolorinto the givenboundsand appends it to the current render node ofsnapshot.You should try to avoid calling this function if
coloris transparent.- Parameters:
color- the color to drawbounds- the bounds for the new node
-
appendConicGradient
public void appendConicGradient(Rect bounds, Point center, float rotation, @Nullable ColorStop @Nullable [] stops) Appends a conic gradient node with the given stops tosnapshot.- Parameters:
bounds- the rectangle to render the gradient intocenter- the center point of the conic gradientrotation- the clockwise rotation in degrees of the starting angle. 0 means the starting angle is the top.stops- the color stops defining the gradient
-
appendFill
A convenience method to fill a path with a color.See
pushFill(org.gnome.gsk.Path, org.gnome.gsk.FillRule)if you need to fill a path with more complex content than a color.- Parameters:
path- The path describing the area to fillfillRule- The fill rule to usecolor- the color to fill the path with- Since:
- 4.14
-
appendInsetShadow
public void appendInsetShadow(RoundedRect outline, RGBA color, float dx, float dy, float spread, float blurRadius) Appends an inset shadow into the box given byoutline.- Parameters:
outline- outline of the region surrounded by shadowcolor- color of the shadowdx- horizontal offset of shadowdy- vertical offset of shadowspread- how far the shadow spreads towards the insideblurRadius- how much blur to apply to the shadow
-
appendLayout
Creates render nodes for renderinglayoutin the given foregoundcolorand appends them to the current node of this Snapshot without changing the current node. The current theme's foreground color for a widget can be obtained withWidget.getColor(org.gnome.gdk.RGBA).Note that if the layout does not produce any visible output, then nodes may not be added to the
snapshot.- Parameters:
layout- thePangoLayoutto rendercolor- the foreground color to render the layout in
-
appendLinearGradient
public void appendLinearGradient(Rect bounds, Point startPoint, Point endPoint, @Nullable ColorStop @Nullable [] stops) Appends a linear gradient node with the given stops tosnapshot.- Parameters:
bounds- the rectangle to render the linear gradient intostartPoint- the point at which the linear gradient will beginendPoint- the point at which the linear gradient will finishstops- the color stops defining the gradient
-
appendNode
Appendsnodeto the current render node ofsnapshot,without changing the current node.If this Snapshot does not have a current node yet,
nodewill become the initial node.- Parameters:
node- aGskRenderNode
-
appendOutsetShadow
public void appendOutsetShadow(RoundedRect outline, RGBA color, float dx, float dy, float spread, float blurRadius) Appends an outset shadow node around the box given byoutline.- Parameters:
outline- outline of the region surrounded by shadowcolor- color of the shadowdx- horizontal offset of shadowdy- vertical offset of shadowspread- how far the shadow spreads towards the outsideblurRadius- how much blur to apply to the shadow
-
appendRadialGradient
public void appendRadialGradient(Rect bounds, Point center, float hradius, float vradius, float start, float end, @Nullable ColorStop @Nullable [] stops) Appends a radial gradient node with the given stops tosnapshot.- Parameters:
bounds- the rectangle to render the readial gradient intocenter- the center point for the radial gradienthradius- the horizontal radiusvradius- the vertical radiusstart- the start position (on the horizontal axis)end- the end position (on the horizontal axis)stops- the color stops defining the gradient
-
appendRepeatingLinearGradient
public void appendRepeatingLinearGradient(Rect bounds, Point startPoint, Point endPoint, @Nullable ColorStop @Nullable [] stops) Appends a repeating linear gradient node with the given stops tosnapshot.- Parameters:
bounds- the rectangle to render the linear gradient intostartPoint- the point at which the linear gradient will beginendPoint- the point at which the linear gradient will finishstops- the color stops defining the gradient
-
appendRepeatingRadialGradient
public void appendRepeatingRadialGradient(Rect bounds, Point center, float hradius, float vradius, float start, float end, @Nullable ColorStop @Nullable [] stops) Appends a repeating radial gradient node with the given stops tosnapshot.- Parameters:
bounds- the rectangle to render the readial gradient intocenter- the center point for the radial gradienthradius- the horizontal radiusvradius- the vertical radiusstart- the start position (on the horizontal axis)end- the end position (on the horizontal axis)stops- the color stops defining the gradient
-
appendScaledTexture
Creates a new render node drawing thetextureinto the givenboundsand appends it to the current render node ofsnapshot.In contrast to
appendTexture(org.gnome.gdk.Texture, org.gnome.graphene.Rect), this function provides control about how the filter that is used when scaling.- Parameters:
texture- the texture to renderfilter- the filter to usebounds- the bounds for the new node- Since:
- 4.10
-
appendStroke
A convenience method to stroke a path with a color.See
pushStroke(org.gnome.gsk.Path, org.gnome.gsk.Stroke)if you need to stroke a path with more complex content than a color.- Parameters:
path- The path describing the area to fillstroke- The stroke attributescolor- the color to fill the path with- Since:
- 4.14
-
appendTexture
Creates a new render node drawing thetextureinto the givenboundsand appends it to the current render node ofsnapshot.If the texture needs to be scaled to fill
bounds,linear filtering is used. SeeappendScaledTexture(org.gnome.gdk.Texture, org.gnome.gsk.ScalingFilter, org.gnome.graphene.Rect)if you need other filtering, such as nearest-neighbour.- Parameters:
texture- the texture to renderbounds- the bounds for the new node
-
freeToNode
Returns the node that was constructed by this Snapshot and freessnapshot.See also
toNode().- Returns:
- a newly-created
RenderNode
-
freeToPaintable
-
glShaderPopTexture
Deprecated.GTK's new Vulkan-focused rendering does not support this feature. UseGLAreafor OpenGL rendering.Removes the top element from the stack of render nodes and adds it to the nearestGLShaderNodebelow it.This must be called the same number of times as the number of textures is needed for the shader in
pushGlShader(org.gnome.gsk.GLShader, org.gnome.graphene.Rect, byte[]). -
perspective
public void perspective(float depth) Applies a perspective projection transform.See
Transform.perspective(float)for a discussion on the details.- Parameters:
depth- distance of the z=0 plane
-
pop
public void pop()Removes the top element from the stack of render nodes, and appends it to the node underneath it. -
pushBlend
Blends together two images with the given blend mode.Until the first call to
pop(), the bottom image for the blend operation will be recorded. After that call, the top image to be blended will be recorded until the second call topop().Calling this function requires two subsequent calls to
pop().- Parameters:
blendMode- blend mode to use
-
pushBlur
public void pushBlur(double radius) Blurs an image.The image is recorded until the next call to
pop().- Parameters:
radius- the blur radius to use. Must be positive
-
pushClip
-
pushColorMatrix
Modifies the colors of an image by applying an affine transformation in RGB space.In particular, the colors will be transformed by applying
pixel = transpose(color_matrix) * pixel + color_offset
for every pixel. The transformation operates on unpremultiplied colors, with color components ordered R, G, B, A.
The image is recorded until the next call to
pop().- Parameters:
colorMatrix- the color matrix to usecolorOffset- the color offset to use
-
pushComponentTransfer
public void pushComponentTransfer(ComponentTransfer red, ComponentTransfer green, ComponentTransfer blue, ComponentTransfer alpha) Modifies the colors of an image by applying a transfer function for each component.The transfer functions operate on unpremultiplied colors.
The image is recorded until the next call to
pop().- Parameters:
red- the transfer for the red componentgreen- the transfer for the green componentblue- the transfer for the blue componentalpha- the transfer for the alpha component- Since:
- 4.20
-
pushCrossFade
public void pushCrossFade(double progress) Snapshots a cross-fade operation between two images with the givenprogress.Until the first call to
pop(), the start image will be snapshot. After that call, the end image will be recorded until the second call topop().Calling this function requires two subsequent calls to
pop().- Parameters:
progress- progress between 0.0 and 1.0
-
pushDebug
Inserts a debug node with a message.Debug nodes don't affect the rendering at all, but can be helpful in identifying parts of a render node tree dump, for example in the GTK inspector.
- Parameters:
message- a printf-style format stringvarargs- arguments formessage
-
pushFill
Fills the area given bypathandfillRulewith an image and discards everything outside of it.The image is recorded until the next call to
pop().If you want to fill the path with a color,
appendFill(org.gnome.gsk.Path, org.gnome.gsk.FillRule, org.gnome.gdk.RGBA)than rendering new ones, useappendFill(org.gnome.gsk.Path, org.gnome.gsk.FillRule, org.gnome.gdk.RGBA)may be more convenient.- Parameters:
path- The path describing the area to fillfillRule- The fill rule to use- Since:
- 4.14
-
pushGlShader
Deprecated.GTK's new Vulkan-focused rendering does not support this feature. UseGLAreafor OpenGL rendering.Push aGLShaderNode.The node uses the given
GLShaderand uniform values Additionally this takes a list ofnChildrenother nodes which will be passed to theGLShaderNode.The
takeArgsargument is a block of data to use for uniform arguments, as per types and offsets defined by theshader.Normally this is generated byGLShader.formatArgs(java.lang.Object...)orGsk.ShaderArgsBuilder.The snapshotter takes ownership of
takeArgs,so the caller should not free it after this.If the renderer doesn't support GL shaders, or if there is any problem when compiling the shader, then the node will draw pink. You should use
GLShader.compile(org.gnome.gsk.Renderer)to ensure theshaderwill work for the renderer before using it.If the shader requires textures (see
GLShader.getNTextures()), then it is expected that you callglShaderPopTexture()the number of times that are required. Each of these calls will generate a node that is added as a child to theGskGLShaderNode, which in turn will render these offscreen and pass as a texture to the shader.Once all textures (if any) are pop:ed, you must call the regular
pop().If you want to use pre-existing textures as input to the shader rather than rendering new ones, use
appendTexture(org.gnome.gdk.Texture, org.gnome.graphene.Rect)to push a texture node. These will be used directly rather than being re-rendered.For details on how to write shaders, see
GLShader.- Parameters:
shader- The code to runbounds- the rectangle to render intotakeArgs- Data block with arguments for the shader.
-
pushMask
-
pushOpacity
public void pushOpacity(double opacity) Modifies the opacity of an image.The image is recorded until the next call to
pop().- Parameters:
opacity- the opacity to use
-
pushRepeat
Creates a node that repeats the child node.The child is recorded until the next call to
pop().- Parameters:
bounds- the bounds within which to repeatchildBounds- the bounds of the child ornullto use the full size of the collected child node
-
pushRoundedClip
Clips an image to a rounded rectangle.The image is recorded until the next call to
pop().- Parameters:
bounds- the rounded rectangle to clip to
-
pushShadow
-
pushStroke
Strokes the givenpathwith the attributes given bystrokeand an image.The image is recorded until the next call to
pop().Note that the strokes are subject to the same transformation as everything else, so uneven scaling will cause horizontal and vertical strokes to have different widths.
If you want to stroke the path with a color,
appendStroke(org.gnome.gsk.Path, org.gnome.gsk.Stroke, org.gnome.gdk.RGBA)may be more convenient.- Parameters:
path- The path to strokestroke- The stroke attributes- Since:
- 4.14
-
renderBackground
@Deprecated public void renderBackground(StyleContext context, double x, double y, double width, double height) Deprecated.Creates a render node for the CSS background according tocontext,and appends it to the current node ofsnapshot,without changing the current node.- Parameters:
context- the style context that defines the backgroundx- X origin of the rectangley- Y origin of the rectanglewidth- rectangle widthheight- rectangle height
-
renderFocus
@Deprecated public void renderFocus(StyleContext context, double x, double y, double width, double height) Deprecated.Creates a render node for the focus outline according tocontext,and appends it to the current node ofsnapshot,without changing the current node.- Parameters:
context- the style context that defines the focus ringx- X origin of the rectangley- Y origin of the rectanglewidth- rectangle widthheight- rectangle height
-
renderFrame
@Deprecated public void renderFrame(StyleContext context, double x, double y, double width, double height) Deprecated.Creates a render node for the CSS border according tocontext,and appends it to the current node ofsnapshot,without changing the current node.- Parameters:
context- the style context that defines the framex- X origin of the rectangley- Y origin of the rectanglewidth- rectangle widthheight- rectangle height
-
renderInsertionCursor
@Deprecated public void renderInsertionCursor(StyleContext context, double x, double y, Layout layout, int index, Direction direction) Deprecated.Draws a text caret using this Snapshot at the specified index oflayout.- Parameters:
context- aGtkStyleContextx- X originy- Y originlayout- thePangoLayoutof the textindex- the index in thePangoLayoutdirection- thePangoDirectionof the text
-
renderLayout
Deprecated.Creates a render node for renderinglayoutaccording to the style information incontext,and appends it to the current node ofsnapshot,without changing the current node.- Parameters:
context- the style context that defines the textx- X origin of the rectangley- Y origin of the rectanglelayout- thePangoLayoutto render
-
restore
public void restore()Restores this Snapshot to the state saved by a preceding call tosave()and removes that state from the stack of saved states. -
rotate
public void rotate(float angle) Rotatessnapshot'scoordinate system byangledegrees in 2D space - or in 3D speak, rotates around the Z axis. The rotation happens around the origin point of (0, 0) in thesnapshot'scurrent coordinate system.To rotate around axes other than the Z axis, use
Transform.rotate3d(float, org.gnome.graphene.Vec3).- Parameters:
angle- the rotation angle, in degrees (clockwise)
-
rotate3d
Rotatessnapshot'scoordinate system byangledegrees aroundaxis.For a rotation in 2D space, use
Transform.rotate(float).- Parameters:
angle- the rotation angle, in degrees (clockwise)axis- The rotation axis
-
save
public void save()Makes a copy of the current state of this Snapshot and saves it on an internal stack.When
restore()is called, this Snapshot will be restored to the saved state.Multiple calls to
save()andrestore()can be nested; each call togtk_snapshot_restore()restores the state from the matching pairedgtk_snapshot_save().It is necessary to clear all saved states with corresponding calls to
gtk_snapshot_restore(). -
scale
public void scale(float factorX, float factorY) Scalessnapshot'scoordinate system in 2-dimensional space by the given factors.Use
scale3d(float, float, float)to scale in all 3 dimensions.- Parameters:
factorX- scaling factor on the X axisfactorY- scaling factor on the Y axis
-
scale3d
public void scale3d(float factorX, float factorY, float factorZ) Scalessnapshot'scoordinate system by the given factors.- Parameters:
factorX- scaling factor on the X axisfactorY- scaling factor on the Y axisfactorZ- scaling factor on the Z axis
-
toNode
Returns the render node that was constructed bysnapshot.Note that this function may return
nullif nothing has been added to the snapshot or if its content does not produce pixels to be rendered.After calling this function, it is no longer possible to add more nodes to
snapshot.The only function that should be called after this isGObject.unref().- Returns:
- the constructed
GskRenderNodeornullif there are no nodes to render.
-
toPaintable
Returns a paintable encapsulating the render node that was constructed bysnapshot.After calling this function, it is no longer possible to add more nodes to
snapshot.The only function that should be called after this isGObject.unref().- Parameters:
size- The size of the resulting paintable ornullto use the bounds of the snapshot- Returns:
- a new
GdkPaintable
-
transform
Transformssnapshot'scoordinate system with the giventransform.- Parameters:
transform- the transform to apply
-
transformMatrix
Transformssnapshot'scoordinate system with the givenmatrix.- Parameters:
matrix- the matrix to multiply the transform with
-
translate
Translatessnapshot'scoordinate system bypointin 2-dimensional space.- Parameters:
point- the point to translate the snapshot by
-
translate3d
Translatessnapshot'scoordinate system bypoint.- Parameters:
point- the point to translate the snapshot by
-
builder
ASnapshot.Builderobject constructs aSnapshotwith the specified properties. Use the variousset...()methods to set properties, and finish construction withSnapshot.Builder.build().- Returns:
- the builder object
-