[Home] [Downloads] [Search] [Help/forum]

MUSHclient scripting

Description of MUSHclient world function: world.WindowBlendImage


Name WindowBlendImage
Type Method
Summary Blends an image into a miniwindow, using a specified blending mode
Prototype long WindowBlendImage(BSTR WindowName, BSTR ImageId, long Left, long Top, long Right, long Bottom, short Mode, double Opacity, long SrcLeft, long SrcTop, long SrcRight, long SrcBottom);

View list of data type meanings

Description

This blends the specified image into the miniwindow, on top of the specified rectangle.

Note that changes to miniwindows will not become visible until the output window is redrawn. This happens when new (visible) lines arrive from the MUD, or if you call WindowShow, or Redraw.

Parameters:

WindowName - the name of an existing miniwindow.

ImageId - an image id that you have previously loaded.

Left, Top, Right, Bottom - describes the destination rectangle. The blend image is merged with the contents of this rectangle to produce the blended result.

Mode - the blending method.

Mode 1 - Normal
Mode 2 - Average
Mode 3 - Interpolate
Mode 4 - Dissolve
Mode 5 - Darken
Mode 6 - Multiply
Mode 7 - Colour Burn
Mode 8 - Linear Burn
Mode 9 - Inverse Colour Burn
Mode 10 - Subtract
Mode 11 - Lighten
Mode 12 - Screen
Mode 13 - Colour Dodge
Mode 14 - Linear Dodge
Mode 15 - Inverse Colour Dodge
Mode 16 - Add
Mode 17 - Overlay
Mode 18 - Soft Light
Mode 19 - Hard Light
Mode 20 - Vivid Light
Mode 21 - Linear Light
Mode 22 - Pin Light
Mode 23 - Hard Mix
Mode 24 - Difference
Mode 25 - Exclusion
Mode 26 - Reflect
Mode 27 - Glow
Mode 28 - Freeze
Mode 29 - Heat
Mode 30 - Negation
Mode 31 - Phoenix
Mode 32 - Stamp
Mode 33 - Xor
Mode 34 - And
Mode 35 - Or
Mode 36 - Red
Mode 37 - Green
Mode 38 - Blue
Mode 39 - Yellow
Mode 40 - Cyan
Mode 41 - Magenta
Mode 42 - Green limited by red
Mode 43 - Green limited by blue
Mode 44 - Green limited by average of red and blue
Mode 45 - Blue limited by red
Mode 46 - Blue limited by green
Mode 47 - Blue limited by average of red and green
Mode 48 - Red limited by green
Mode 49 - Red limited by blue
Mode 50 - Red limited by average of green and blue
Mode 51 - Red only
Mode 52 - Green only
Mode 53 - Blue only
Mode 54 - Discard red
Mode 55 - Discard green
Mode 56 - Discard blue
Mode 57 - All red
Mode 58 - All green
Mode 59 - All blue
Mode 60 - Hue mode
Mode 61 - Saturation mode
Mode 62 - Colour mode
Mode 63 - Luminance mode
Mode 64 - HSL

Opacity - the amount of opacity, between 0 and 1 (floating-point number). An opacity of 0 means you will not see the blend image. An opacity of 1 means the blend is fully applied. An opacity of 0.5 means the blended image is merged 50% with the original contents of the miniwindow.

SrcLeft, SrcTop, SrcRight, SrcBottom - the source rectangle in the original image (use 0,0,0,0 to get the whole image). Negative numbers for the SrcRight and SrcBottom parameters represent an offset from the bottom or right edge.

When blending, whichever rectangle is smaller is the one used for the width and height of the operation (the destination rectangle or the source rectangle).

See also BlendPixel for blending individual pixels.


For more information and screen shots showing the effects of various modes, see:

http://www.gammon.com.au/mushclient/mw_blending.htm


Note: Available in version 4.35 onwards.


Lua example
WindowBlendImage (win, "im", 0, 0, 0, 0, 1, 0.5)  -- mode 1 (normal) at 50% opacity
Lua notes
In Lua you can use the following constants for the blending modes:

miniwin.blend_normal = 1
miniwin.blend_average = 2
miniwin.blend_interpolate = 3
miniwin.blend_dissolve = 4
miniwin.blend_darken = 5
miniwin.blend_multiply = 6
miniwin.blend_colour_burn = 7
miniwin.blend_linear_burn = 8
miniwin.blend_inverse_colour_burn = 9
miniwin.blend_subtract = 10
miniwin.blend_lighten = 11
miniwin.blend_screen = 12
miniwin.blend_colour_dodge = 13
miniwin.blend_linear_dodge = 14
miniwin.blend_inverse_colour_dodge = 15
miniwin.blend_add = 16
miniwin.blend_overlay = 17
miniwin.blend_soft_light = 18
miniwin.blend_hard_light = 19
miniwin.blend_vivid_light = 20
miniwin.blend_linear_light = 21
miniwin.blend_pin_light = 22
miniwin.blend_hard_mix = 23
miniwin.blend_difference = 24
miniwin.blend_exclusion = 25
miniwin.blend_reflect = 26
miniwin.blend_glow = 27
miniwin.blend_freeze = 28
miniwin.blend_heat = 29
miniwin.blend_negation = 30
miniwin.blend_phoenix = 31
miniwin.blend_stamp = 32
miniwin.blend_xor = 33
miniwin.blend_and = 34
miniwin.blend_or = 35
miniwin.blend_red = 36
miniwin.blend_green = 37
miniwin.blend_blue = 38
miniwin.blend_yellow = 39
miniwin.blend_cyan = 40
miniwin.blend_magenta = 41
miniwin.blend_green_limited_by_red = 42
miniwin.blend_green_limited_by_blue = 43
miniwin.blend_green_limited_by_average_of_red_and_blue = 44
miniwin.blend_blue_limited_by_red = 45
miniwin.blend_blue_limited_by_green = 46
miniwin.blend_blue_limited_by_average_of_red_and_green = 47
miniwin.blend_red_limited_by_green = 48
miniwin.blend_red_limited_by_blue = 49
miniwin.blend_red_limited_by_average_of_green_and_blue = 50
miniwin.blend_red_only = 51
miniwin.blend_green_only = 52
miniwin.blend_blue_only = 53
miniwin.blend_discard_red = 54
miniwin.blend_discard_green = 55
miniwin.blend_discard_blue = 56
miniwin.blend_all_red = 57
miniwin.blend_all_green = 58
miniwin.blend_all_blue = 59
miniwin.blend_hue_mode = 60
miniwin.blend_saturation_mode = 61
miniwin.blend_colour_mode = 62
miniwin.blend_luminance_mode = 63
miniwin.blend_hsl = 64
Returns eNoSuchWindow - no such miniwindow

eImageNotInstalled - that image was not loaded with WindowLoadImage

eBadParameter - Opacity less than zero or greater than 1.

eOK - completed OK

View list of return code meanings

Introduced in version 4.35

See also ...

Function Description
BlendPixel Blends a single pixel with another, using a specified blending mode
WindowCreate Creates a miniwindow
WindowCreateImage Creates an image in a miniwindow
WindowDrawImage Draws an image into a miniwindow
WindowImageInfo Returns information about an image
WindowImageList Lists all images installed into a miniwindow
WindowImageOp Draws an ellipse, rectangle or round rectangle, filled with an image
WindowLoadImage Loads an image into a miniwindow from a disk file

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.


Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes


Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes


View all functions

[Back]

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]