Search FAQ

WindowBlendImage

Script function

world.WindowBlendImage

Read about scripting

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


Available in MUSHclient 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


Return value

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

See Also ...

Topic

MiniWindows

Functions

(BlendPixel) Blends a single pixel with another, using a specified blending mode
(GetDeviceCaps) Gets screen device capabilities
(SetCursor) Changes the shape of the mouse cursor
(TextRectangle) Specifies the size of the rectangle in which text is displayed in the output window.
(WindowAddHotspot) Adds a hotspot to a miniwindow
(WindowArc) Draws an arc in a miniwindow
(WindowBezier) Draws a Bézier curve in a miniwindow
(WindowCircleOp) Draws ellipses, filled rectangles, round rectangles, chords, pies in a miniwindow
(WindowCreate) Creates a miniwindow
(WindowCreateImage) Creates an image in a miniwindow
(WindowDelete) Deletes a miniwindow
(WindowDeleteAllHotspots) Deletes all hotspots from a miniwindow
(WindowDeleteHotspot) Deletes a hotspot from a miniwindow
(WindowDragHandler) Adds a drag handler to a miniwindow hotspot
(WindowDrawImage) Draws an image into a miniwindow
(WindowDrawImageAlpha) Draws an image into a miniwindow respecting the alpha channel
(WindowFilter) Performs a filtering operation over part of the miniwindow.
(WindowFont) Loads a font into a miniwindow
(WindowFontInfo) Returns information about a font
(WindowFontList) Lists all fonts loaded into a miniwindow
(WindowGetImageAlpha) Draws the alpha channel of an image into a miniwindow
(WindowGetPixel) Gets the colour of a single pixel in a miniwindow
(WindowGradient) Draws a gradient in a rectangle
(WindowHotspotInfo) Returns information about a hotspot
(WindowHotspotList) Lists all hotspots installed into a miniwindow
(WindowHotspotTooltip) Changes the tooltip text for a hotspot in a miniwindow
(WindowImageFromWindow) Creates an image from another 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
(WindowInfo) Returns information about a miniwindow
(WindowLine) Draws a line in a miniwindow
(WindowList) Lists all miniwindows
(WindowLoadImage) Loads an image into a miniwindow from a disk file
(WindowMenu) Creates a pop-up menu inside a miniwindow
(WindowMergeImageAlpha) Merges an image into a miniwindow based on an alpha mask
(WindowMoveHotspot) Moves a hotspot in a miniwindow
(WindowPolygon) Draws a polygon in a miniwindow
(WindowPosition) Moves a miniwindow
(WindowRectOp) Draws a rectangle in a miniwindow
(WindowResize) Resizes a miniwindow
(WindowScrollwheelHandler) Adds a scroll-wheel handler to a miniwindow hotspot
(WindowSetPixel) Sets a single pixel in a miniwindow to the specified colour
(WindowSetZOrder) Sets the Z-Order for a miniwindow
(WindowShow) Shows or hides a miniwindow
(WindowText) Draws text into a miniwindow
(WindowTextWidth) Calculates the width of text in a miniwindow
(WindowTransformImage) Draws an image into a miniwindow with optional rotation, scaling, reflection and shearing
(WindowWrite) Writes the contents of a miniwindow to disk as a graphics file

(Help topic: function=WindowBlendImage)

Documentation contents page


Search ...

Enter a search string to find matching documentation.

Search for:   

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