MessageClip

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (added category:Debugging/Diagnostic_filters)
(add link to avs+ documentation)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Template:FuncDef|MessageClip(string ''message'', int ''width'', int ''height'', bool ''shrink'', int ''text_color'', int ''halo_color'', int ''bg_color'')}}
+
<div style="max-width:62em" >
 +
<div {{BlueBox2|40|0|3px solid purple}} >
 +
{{AvsPlusFullname}}<br>
 +
Up-to-date documentation: [https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/corefilters/message.html https://avisynthplus.readthedocs.io]
 +
</div>
  
MessageClip produces a clip containing a text message; used internally for error reporting. Arial font is used, size between 24 points and 9 points chosen to fit, if possible, in the width by height clip.
 
  
If ''shrink'' is true, the clip resolution is then reduced, if necessary, to fit the text.
+
'''MessageClip''' produces a clip containing a text message. Used internally for error reporting.
 +
 
 +
The font face is "Arial". The font size is between 24 points and 9 points - chosen to fit, if possible, in the width by height clip. The pixeltype is RGB32.
 +
</div>
 +
 
 +
 
 +
== Syntax and Parameters ==
 +
<div style="max-width:62em" >
 +
{{FuncDef
 +
|MessageClip(string ''message'' [, int ''width'', int ''height'', bool ''shrink'', int ''text_color'', int ''halo_color'', int ''bg_color'' ] )
 +
}}
 +
 
 +
:{{Par2|message|string|}}
 +
:: The message to be displayed. Required.
 +
 
 +
:{{Par2|width|int|-1}}
 +
:{{Par2|height|int|-1}}
 +
:: Width and height of the resulting clip. By default, the width and height are chosen such that it can display the message with size 24 points.
 +
 
 +
:{{Par2|shrink|bool|false}}
 +
::If true, and {{FuncArg|width}} and/or {{FuncArg|Height}} are specified, the clip resolution is reduced to a smaller size, if possible, to fit the text.  
 +
::If false (the default), the text will appear at the top-center of the video frame.
 +
 
 +
:{{Par2|text_color|int|[[Preset colors|color_white]]}}
 +
:{{Par2|halo_color|int|[[Preset colors|color_black]]}}
 +
:{{Par2|bg_color|int|[[Preset colors|color_black]]}}
 +
::Colors for font fill, outline and background respectively. Default white, black, black.
 +
</div>
 +
 
 +
 
 +
== Examples ==
 +
<div style="max-width:62em" >
 +
<div {{BoxWidthIndent|46|0}} >
 +
MessageClip([[Internal_functions#VersionString|VersionString]])
 +
</div>
 +
:[[File:MessageClip2-black.png]]
 +
 
 +
 
 +
<div {{BoxWidthIndent|46|0}} >
 +
  MessageClip(VersionString, ''width=240'')
 +
</div>
 +
:[[File:MessageClip4-240px.png]]
 +
 
 +
 
 +
<div {{BoxWidthIndent|46|0}} >
 +
MessageClip(VersionString, ''bg_color=$ff0000'')
 +
</div>
 +
:[[File:MessageClip3-red.png]]
 +
 
 +
 
 +
<div {{BoxWidthIndent|46|0}} >
 +
  MessageClip(VersionString, bg_color=$ff0000, ''height=80'')
 +
</div>
 +
:[[File:MessageClip3-red-hgt80.png]]
 +
 
 +
 
 +
<div {{BoxWidthIndent|46|0}} >
 +
  MessageClip(VersionString, bg_color=$ff0000, height=80, ''shrink=true'')
 +
</div>
 +
:[[File:MessageClip3-red.png]]
 +
</div>
  
  
 
[[Category:Internal filters]]
 
[[Category:Internal filters]]
 
[[Category:Debugging/Diagnostic filters]]
 
[[Category:Debugging/Diagnostic filters]]

Latest revision as of 07:21, 18 September 2022

AviSynth+
Up-to-date documentation: https://avisynthplus.readthedocs.io


MessageClip produces a clip containing a text message. Used internally for error reporting.

The font face is "Arial". The font size is between 24 points and 9 points - chosen to fit, if possible, in the width by height clip. The pixeltype is RGB32.


[edit] Syntax and Parameters

MessageClip(string message [, int width, int height, bool shrink, int text_color, int halo_color, int bg_color ] )

string  message =
The message to be displayed. Required.
int  width = -1
int  height = -1
Width and height of the resulting clip. By default, the width and height are chosen such that it can display the message with size 24 points.
bool  shrink = false
If true, and width and/or Height are specified, the clip resolution is reduced to a smaller size, if possible, to fit the text.
If false (the default), the text will appear at the top-center of the video frame.
int  text_color = color_white
int  halo_color = color_black
int  bg_color = color_black
Colors for font fill, outline and background respectively. Default white, black, black.


[edit] Examples

MessageClip(VersionString)
MessageClip2-black.png


 MessageClip(VersionString, width=240) 
MessageClip4-240px.png


MessageClip(VersionString, bg_color=$ff0000) 
MessageClip3-red.png


 MessageClip(VersionString, bg_color=$ff0000, height=80)
MessageClip3-red-hgt80.png


 MessageClip(VersionString, bg_color=$ff0000, height=80, shrink=true)
MessageClip3-red.png
Personal tools