This page is part of a static HTML representation of the TiddlyWiki at https://tiddlywiki.com/

WidgetMessage: tm-edit-bitmap-operation

3rd August 2023 at 4:58am

A tm-edit-bitmap-operation invokes one of the available operations on a surrounding bitmap editor. Therefore the message has to be dispatched within the editor in order for it to catch it. The following properties on the event object are required:

NameDescription
paramName of the operation to be executed, see below for a list of possible operations
{any other params}Any other parameters are made available as variables within the context of the widget message.

The tm-edit-bitmap-operation message is usually generated by a ButtonWidget or an ActionWidget and is handled by the surrounding bitmap editor.

Bitmap Operations

At this point the following bitmap operations have been implemented:

NameDescription
resize

Resizes the image to the specified width and height. Parameters include:

NameDescription
widthSpecifies the width the image is resized to
heightSpecifies the height the image is resized to
clear

Clears the contents of the image and fills it with a solid colour. Parameters include:

NameDescription
colourColour the image should be filled with, defaults to White

Tip
The colour field can take any normal CSS colour value, including the hexadecimal representation or the RGB format.

Example

An example can be seen in $:/core/ui/EditorToolbar/size-dropdown:

<$button>
<$action-sendmessage
	$message="tm-edit-bitmap-operation"
	$param="resize"
	width={{$config-title$/new-width}}
	height={{$config-title$/new-height}}
/>
...
Resize
</$button>