Unit msegraphics

Description

 

Overview

Classes, Interfaces, Objects and Records

Name Description
Record fonthashdty  
Record fonthashdataty  
Record fontdataty  
Record fontmetricsty  
Record basefontinfoty  
Record fontinfoty  
Record imagety  
Record maskedimagety  
Interface icanvas  
Record gcty  
Record bufferty  
Record rectinfoty  
Record arcinfoty  
Record posinfoty  
Record textposinfoty  
Record text16posinfoty  
Record pointsinfoty  
Record colorinfoty  
Record getfontinfoty  
Record gettext16widthinfoty  
Record getchar16widthsinfoty  
Record getfontmetricsinfoty  
Record copyareainfoty  
Record fonthasglyphinfoty  
Record regionoperationinfoty  
Record createpixmapinfoty  
Record pixmapimageinfoty  
Record creategcinfoty  
Record getimageinfoty  
Record getcanvasclassinfoty  
Record moverectinfoty  
Record lineinfoty  
Record gcvaluesty  
Record drawinfoty  
Class tfonttemplate  
Class tfontcomp  
Class tfont  
Class toptionalfont  
Class tparentfont  
Class tcanvasfont  
Record canvasvaluesty  
Record canvasvaluestackty  
Record edgecolorinfoty  
Record edgecolorpairinfoty  
Record framecolorinfoty  
Class tcanvas  
Record pixmapinfoty  
Class tsimplebitmap  
Record editfontcolorinfoty  

Functions and Procedures

procedure init;
procedure deinit;
procedure initdefaultvalues(var avalue: edgecolorinfoty);
procedure initdefaultvalues(var avalue: edgecolorpairinfoty);
procedure drawinfoinit(var info: drawinfoty);
procedure gdi_lock();
procedure gdi_unlock();
function gdi_locked(): boolean;
function gdi_unlockall(): int32;
procedure gdi_relockall(const acount: int32);
procedure gdi_call(const func: gdifuncty; var drawinfo: drawinfoty; gdi: pgdifunctionaty = nil);
function getdefaultgdifuncs: pgdifunctionaty;
function registergdi(const agdifuncs: pgdifunctionaty): integer;
function getgdicanvasclass(const agdi: pgdifunctionaty; const akind: bitmapkindty): canvasclassty;
function creategdicanvas(const agdi: pgdifunctionaty; const akind: bitmapkindty; const user: tobject; const intf: icanvas): tcanvas;
procedure freefontdata(var drawinfo: drawinfoty);
procedure allocbuffer(var buffer: bufferty; size: integer);
procedure extendbuffer(var buffer: bufferty; const extension: integer; var reference: pointer);
function replacebuffer(var buffer: bufferty; size: integer): pointer;
procedure freebuffer(var buffer: bufferty);
procedure gdierrorlocked(error: gdierrorty; const text: msestring = ''); overload;
procedure gdierrorlocked(error: gdierrorty; sender: tobject; text: msestring = ''); overload;
function colortorgb(color: colorty): rgbtriplety;
function colortopixel(color: colorty): pixelty;
function graytopixel(color: colorty): pixelty;
function rgbtocolor(const red,green,blue: integer): colorty;
function blendcolor(const weight: real; const a,b: colorty): colorty;
function opacitycolor(const opacity: real): colorty;
function invertcolor(const color: colorty): colorty;
procedure setcolormapvalue(index: colorty; const red,green,blue: integer); overload;
procedure setcolormapvalue(const index: colorty; const acolor: colorty); overload;
function isvalidmapcolor(index: colorty): boolean;
function transparencytoopacity(const trans: colorty): colorty;
procedure drawdottedlinesegments(const acanvas: tcanvas; const lines: segmentarty; const colorline: colorty);
procedure allocimage(out image: imagety; const asize: sizety; const akind: bitmapkindty);
procedure freeimage(var image: imagety);
procedure freeimage(var image: maskedimagety);
procedure zeropad(var image: imagety);
procedure checkimagebgr(var aimage: imagety; const bgr: boolean);
procedure movealignment(const source: alignmentsty; var dest: alignmentsty);

Types

gckindty = (...);
drawingflagty = (...);
drawingflagsty = set of drawingflagty;
capstylety = (...);
joinstylety = (...);
dashesstringty = string[8];
fontoptionty = (...);
fontoptionsty = set of fontoptionty;
canvasstatety = (...);
canvasstatesty = set of canvasstatety;
pgdifunctionaty = ˆgdifunctionaty;
fontdatapty = array[0..15] of pointer;
pfontdataty = ˆfontdataty;
pfontmetricsty = ˆfontmetricsty;
rasteropty = (...);
fontchangedeventty = procedure(sender: tfont; changed: canvasstatesty) of object;
fontstatety = (...);
fontstatesty = set of fontstatety;
fontnumty = longword;
fontaliasmodety = (...);
fontlocalpropty = (...);
fontlocalpropsty = set of fontlocalpropty;
pfontinfoty = ˆfontinfoty;
bitmapkindty = (...);
pimagety = ˆimagety;
canvasclassty = class of tcanvas;
gcpty = array[0..63] of pointer;
pgcty = ˆgcty;
pdrawinfoty = ˆdrawinfoty;
rectsty = array[0..bigint div sizeof(rectty)] of rectty;
prectsty = ˆrectsty;
gcvaluemaskty = (...);
gcvaluemasksty = set of gcvaluemaskty;
canvasoptionty = (...);
canvasoptionsty = set of canvasoptionty;
pgcvaluesty = ˆgcvaluesty;
getfontfuncty = function (var drawinfo: drawinfoty): boolean of object;
pfont = ˆtfont;
fontarty = array of tfont;
parentfontclassty = class of tparentfont;
gdifunctionty = procedure(var drawinfo: drawinfoty);
gdifuncty = (...);
gdifunctionaty = array[gdifuncty] of gdifunctionty;
canvasvaluespoty = ˆcanvasvaluesty;
canvasvaluesarty = array of canvasvaluesty;
edgeinfoty = (...);
edgeinfosty = set of edgeinfoty;
gdiintffuncty = procedure (func: gdifuncty; var drawinfo: drawinfoty);
canvasarty = array of tcanvas;
pixmapstatety = (...);
pixmapstatesty = set of pixmapstatety;

Constants

linewidthshift = 16;
linewidthroundvalue = $8000;
fontsizeshift = 16;
fontsizeroundvalue = $8000;
defaultfontalias = 'stf_default';
invalidgchandle = ptruint(-1);
fillmodeinfoflags = [df_opaque,df_monochrome,df_brush];
da_dot = dashesstringty(#1#1);
da_dash = dashesstringty(#3#3);
da_dashdot = dashesstringty(#3#1#1#1);
fontpitchmask = [foo_fixed,foo_proportional];
fontfamilymask = [foo_helvetica,foo_roman,foo_script,foo_decorative];
fontantialiasedmask = [foo_antialiased,foo_antialiased2,foo_nonantialiased];
fontaliasoptionchars : array[fontoptionty] of char = ('p','P','H','R','S','D','A','B','a');
linecanvasstates = [cs_dashes,cs_linewidth,cs_capstyle,cs_joinstyle];
fontstylehandlemask = 3;
fontstylesmamask: fontstylesty = [fs_bold,fs_italic,fs_underline,fs_strikeout,fs_selected];
nullgc: gcty = (handle: 0);
changedmask = [cs_clipregion,cs_origin,cs_rasterop,cs_options, cs_acolorbackground,cs_acolorforeground, cs_color,cs_colorbackground, cs_fonthandle,cs_font,cs_fontcolor,cs_fontcolorbackground, cs_fonteffect, cs_brush,cs_brushorigin] + linecanvasstates;

Variables

defaultframecolors: framecolorinfoty = (edges:(light: (color: cl_light; effectcolor: cl_highlight; effectwidth: 1); shadow: (color: cl_shadow; effectcolor: cl_dkshadow; effectwidth: 1); ); frame: cl_black; hiddenedges: [] );
defaulteditfontcolors: editfontcolorinfoty = ( text: cl_text; textbackground: cl_transparent; selectedtext: cl_selectedtext; selectedtextbackground: cl_selectedtextbackground; );
flushgdi: boolean;

Description

Functions and Procedures

procedure init;
 
procedure deinit;
 
procedure initdefaultvalues(var avalue: edgecolorinfoty);
 
procedure initdefaultvalues(var avalue: edgecolorpairinfoty);
 
procedure drawinfoinit(var info: drawinfoty);
 
procedure gdi_lock();
 
procedure gdi_unlock();
 
function gdi_locked(): boolean;
 
function gdi_unlockall(): int32;
 
procedure gdi_relockall(const acount: int32);
 
procedure gdi_call(const func: gdifuncty; var drawinfo: drawinfoty; gdi: pgdifunctionaty = nil);
 
function getdefaultgdifuncs: pgdifunctionaty;
 
function registergdi(const agdifuncs: pgdifunctionaty): integer;
 
function getgdicanvasclass(const agdi: pgdifunctionaty; const akind: bitmapkindty): canvasclassty;
 
function creategdicanvas(const agdi: pgdifunctionaty; const akind: bitmapkindty; const user: tobject; const intf: icanvas): tcanvas;
 
procedure freefontdata(var drawinfo: drawinfoty);
 
procedure allocbuffer(var buffer: bufferty; size: integer);
 
procedure extendbuffer(var buffer: bufferty; const extension: integer; var reference: pointer);
 
function replacebuffer(var buffer: bufferty; size: integer): pointer;
 
procedure freebuffer(var buffer: bufferty);
 
procedure gdierrorlocked(error: gdierrorty; const text: msestring = ''); overload;
 
procedure gdierrorlocked(error: gdierrorty; sender: tobject; text: msestring = ''); overload;
 
function colortorgb(color: colorty): rgbtriplety;
 
function colortopixel(color: colorty): pixelty;
 
function graytopixel(color: colorty): pixelty;
 
function rgbtocolor(const red,green,blue: integer): colorty;
 
function blendcolor(const weight: real; const a,b: colorty): colorty;
 
function opacitycolor(const opacity: real): colorty;
 
function invertcolor(const color: colorty): colorty;
 
procedure setcolormapvalue(index: colorty; const red,green,blue: integer); overload;
 
procedure setcolormapvalue(const index: colorty; const acolor: colorty); overload;
 
function isvalidmapcolor(index: colorty): boolean;
 
function transparencytoopacity(const trans: colorty): colorty;
 
procedure drawdottedlinesegments(const acanvas: tcanvas; const lines: segmentarty; const colorline: colorty);
 
procedure allocimage(out image: imagety; const asize: sizety; const akind: bitmapkindty);
 
procedure freeimage(var image: imagety);
 
procedure freeimage(var image: maskedimagety);
 
procedure zeropad(var image: imagety);
 
procedure checkimagebgr(var aimage: imagety; const bgr: boolean);
 
procedure movealignment(const source: alignmentsty; var dest: alignmentsty);
 

Types

gckindty = (...);
 
Values
  • gck_screen
  • gck_pixmap
  • gck_printer
  • gck_metafile
drawingflagty = (...);
 
Values
  • df_canvasispixmap
  • df_canvasismonochrome
  • df_highresfont
  • df_doublebuffer
  • df_smooth
  • df_colorconvert
  • df_opaque
  • df_monochrome
  • df_brush
  • df_dashed
  • df_last = 31
drawingflagsty = set of drawingflagty;
 
capstylety = (...);
 
Values
  • cs_butt
  • cs_round
  • cs_projecting
joinstylety = (...);
 
Values
  • js_miter
  • js_round
  • js_bevel
dashesstringty = string[8];
 
fontoptionty = (...);
 
Values
  • foo_fixed
  • foo_proportional
  • foo_helvetica
  • foo_roman
  • foo_script
  • foo_decorative
  • foo_antialiased
  • foo_antialiased2
  • foo_nonantialiased
fontoptionsty = set of fontoptionty;
 
canvasstatety = (...);
 
Values
  • cs_regioncopy
  • cs_clipregion
  • cs_origin
  • cs_gc
  • cs_acolorbackground
  • cs_acolorforeground
  • cs_color
  • cs_colorbackground
  • cs_dashes
  • cs_linewidth
  • cs_capstyle
  • cs_joinstyle
  • cs_options
  • cs_fonthandle
  • cs_font
  • cs_fontcolor
  • cs_fontcolorbackground
  • cs_fonteffect
  • cs_rasterop
  • cs_brush
  • cs_brushorigin
  • cs_painted
  • cs_internaldrawtext
  • cs_highresdevice
  • cs_inactive
  • cs_pagestarted
  • cs_metafile
canvasstatesty = set of canvasstatety;
 
pgdifunctionaty = ˆgdifunctionaty;
 
fontdatapty = array[0..15] of pointer;
 
pfontdataty = ˆfontdataty;
 
pfontmetricsty = ˆfontmetricsty;
 
rasteropty = (...);
 
Values
  • rop_clear
  • rop_and
  • rop_andnot
  • rop_copy
  • rop_notand
  • rop_nop
  • rop_xor
  • rop_or
  • rop_nor
  • rop_notxor
  • rop_not
  • rop_ornot
  • rop_notcopy
  • rop_notor
  • rop_nand
  • rop_set
fontchangedeventty = procedure(sender: tfont; changed: canvasstatesty) of object;
 
fontstatety = (...);
 
Values
  • fsta_infovalid
  • fsta_none
fontstatesty = set of fontstatety;
 
fontnumty = longword;
 
fontaliasmodety = (...);
 
Values
  • fam_nooverwrite
  • fam_overwrite
  • fam_fix
  • fam_fixnooverwrite
fontlocalpropty = (...);
 
Values
  • flp_color
  • flp_colorbackground
  • flp_colorselect
  • flp_colorselectbackground
  • flp_shadow_color
  • flp_shadow_shiftx
  • flp_shadow_shifty
  • flp_gloss_color
  • flp_gloss_shiftx
  • flp_gloss_shifty
  • flp_grayed_color
  • flp_grayed_colorshadow
  • flp_grayed_shiftx
  • flp_grayed_shifty
  • flp_style
  • flp_xscale
  • flp_height
  • flp_width
  • flp_extraspace
  • flp_name
  • flp_charset
  • flp_options
fontlocalpropsty = set of fontlocalpropty;
 
pfontinfoty = ˆfontinfoty;
 
bitmapkindty = (...);
 
Values
  • bmk_mono
  • bmk_gray
  • bmk_rgb
pimagety = ˆimagety;
 
canvasclassty = class of tcanvas;
 
gcpty = array[0..63] of pointer;
 
pgcty = ˆgcty;
 
pdrawinfoty = ˆdrawinfoty;
 
rectsty = array[0..bigint div sizeof(rectty)] of rectty;
 
prectsty = ˆrectsty;
 
gcvaluemaskty = (...);
 
Values
  • gvm_clipregion
  • gvm_colorbackground
  • gvm_colorforeground
  • gvm_dashes
  • gvm_linewidth
  • gvm_capstyle
  • gvm_joinstyle
  • gvm_options
  • gvm_font
  • gvm_brush
  • gvm_brushorigin
  • gvm_rasterop
  • gvm_brushflag
gcvaluemasksty = set of gcvaluemaskty;
 
canvasoptionty = (...);
 
Values
  • cao_smooth
canvasoptionsty = set of canvasoptionty;
 
pgcvaluesty = ˆgcvaluesty;
 
getfontfuncty = function (var drawinfo: drawinfoty): boolean of object;
 
pfont = ˆtfont;
 
fontarty = array of tfont;
 
parentfontclassty = class of tparentfont;
 
gdifunctionty = procedure(var drawinfo: drawinfoty);
 
gdifuncty = (...);
 
Values
  • gdf_creategc
  • gdf_destroygc
  • gdf_changegc
  • gdf_createpixmap
  • gdf_pixmaptoimage
  • gdf_imagetopixmap
  • gdf_getcanvasclass
  • gdf_endpaint
  • gdf_flush
  • gdf_movewindowrect
  • gdf_drawlines
  • gdf_drawlinesegments
  • gdf_drawellipse
  • gdf_drawarc
  • gdf_fillrect
  • gdf_fillellipse
  • gdf_fillarc
  • gdf_fillpolygon
  • gdf_drawstring16
  • gdf_setcliporigin
  • gdf_createemptyregion
  • gdf_createrectregion
  • gdf_createrectsregion
  • gdf_destroyregion
  • gdf_copyregion
  • gdf_moveregion
  • gdf_regionisempty
  • gdf_regionclipbox
  • gdf_regsubrect
  • gdf_regsubregion
  • gdf_regaddrect
  • gdf_regaddregion
  • gdf_regintersectrect
  • gdf_regintersectregion
  • gdf_copyarea
  • gdf_getimage
  • gdf_fonthasglyph
  • gdf_getfont
  • gdf_getfonthighres
  • gdf_freefontdata
  • gdf_gettext16width
  • gdf_getchar16widths
  • gdf_getfontmetrics
gdifunctionaty = array[gdifuncty] of gdifunctionty;
 
canvasvaluespoty = ˆcanvasvaluesty;
 
canvasvaluesarty = array of canvasvaluesty;
 
edgeinfoty = (...);
 
Values
  • kin_dark
  • kin_reverseend
  • kin_reversestart
edgeinfosty = set of edgeinfoty;
 
gdiintffuncty = procedure (func: gdifuncty; var drawinfo: drawinfoty);
 
canvasarty = array of tcanvas;
 
pixmapstatety = (...);
 
Values
  • pms_ownshandle
  • pms_maskvalid
  • pms_nosave
  • pms_staticcanvas
pixmapstatesty = set of pixmapstatety;
 

Constants

linewidthshift = 16;
 
linewidthroundvalue = $8000;
 
fontsizeshift = 16;
 
fontsizeroundvalue = $8000;
 
defaultfontalias = 'stf_default';
 
invalidgchandle = ptruint(-1);
 
fillmodeinfoflags = [df_opaque,df_monochrome,df_brush];
 
da_dot = dashesstringty(#1#1);
 
da_dash = dashesstringty(#3#3);
 
da_dashdot = dashesstringty(#3#1#1#1);
 
fontpitchmask = [foo_fixed,foo_proportional];
 
fontfamilymask = [foo_helvetica,foo_roman,foo_script,foo_decorative];
 
fontantialiasedmask = [foo_antialiased,foo_antialiased2,foo_nonantialiased];
 
fontaliasoptionchars : array[fontoptionty] of char = ('p','P','H','R','S','D','A','B','a');
 
linecanvasstates = [cs_dashes,cs_linewidth,cs_capstyle,cs_joinstyle];
 
fontstylehandlemask = 3;
 
fontstylesmamask: fontstylesty = [fs_bold,fs_italic,fs_underline,fs_strikeout,fs_selected];
 
nullgc: gcty = (handle: 0);
 
changedmask = [cs_clipregion,cs_origin,cs_rasterop,cs_options, cs_acolorbackground,cs_acolorforeground, cs_color,cs_colorbackground, cs_fonthandle,cs_font,cs_fontcolor,cs_fontcolorbackground, cs_fonteffect, cs_brush,cs_brushorigin] + linecanvasstates;
 

Variables

defaultframecolors: framecolorinfoty = (edges:(light: (color: cl_light; effectcolor: cl_highlight; effectwidth: 1); shadow: (color: cl_shadow; effectcolor: cl_dkshadow; effectwidth: 1); ); frame: cl_black; hiddenedges: [] );
 
defaulteditfontcolors: editfontcolorinfoty = ( text: cl_text; textbackground: cl_transparent; selectedtext: cl_selectedtext; selectedtextbackground: cl_selectedtextbackground; );
 
flushgdi: boolean;
 

Generated by PasDoc 0.16.0.