diff --git a/Units/MMLAddon/mmlpsthread.pas b/Units/MMLAddon/mmlpsthread.pas index 22e7e01..c84e3fa 100644 --- a/Units/MMLAddon/mmlpsthread.pas +++ b/Units/MMLAddon/mmlpsthread.pas @@ -688,6 +688,7 @@ begin RegisterMethod('procedure Posterize(TargetBitmap : TMufasaBitmap; Po : integer);'); RegisterMethod('function Copy(const xs,ys,xe,ye : integer) : TMufasaBitmap;'); RegisterMethod('function ToString : string;'); + RegisterMethod('function ToTBitmap : TBitmap;'); RegisterMethod('function CreateTMask : TMask;'); RegisterMethod('constructor create'); RegisterMethod('procedure Free'); @@ -815,6 +816,7 @@ begin; PSClass :=cl.Add(TMufasaBitmap); with PSClass do begin + RegisterMethod(@TMufasaBitmap.ToTBitmap,'ToTBitmap'); RegisterMethod(@TMufasaBitmap.SetSize,'SETSIZE'); RegisterMethod(@TMufasaBitmap.StretchResize,'STRETCHRESIZE'); RegisterMethod(@TMufasaBitmap.FastSetPixel,'FASTSETPIXEL'); diff --git a/Units/PascalScript/uPSC_graphics.pas b/Units/PascalScript/uPSC_graphics.pas index 2e4c92b..56f8b21 100644 --- a/Units/PascalScript/uPSC_graphics.pas +++ b/Units/PascalScript/uPSC_graphics.pas @@ -16,6 +16,7 @@ procedure SIRegisterTBRUSH(Cl: TPSPascalCompiler); procedure SIRegisterTCanvas(cl: TPSPascalCompiler); procedure SIRegisterTGraphic(CL: TPSPascalCompiler); procedure SIRegisterTBitmap(CL: TPSPascalCompiler; Streams: Boolean); +procedure SIRegisterTPicture(CL: TPSPascalCompiler); procedure SIRegister_Graphics(Cl: TPSPascalCompiler; Streams: Boolean); @@ -258,6 +259,14 @@ begin end; end; +procedure SIRegisterTPicture(CL: TPSPascalCompiler); +begin + with TPSCompileTimeClass(CL.AddClassN(CL.FindClass('TPersistent'),'TPicture')) do + begin + RegisterProperty('Bitmap','TBitmap',iptrw); + end; +end; + procedure SIRegister_Graphics(Cl: TPSPascalCompiler; Streams: Boolean); begin SIRegister_Graphics_TypesAndConsts(Cl); @@ -268,6 +277,7 @@ begin SIRegisterTCanvas(cl); SIRegisterTGraphic(Cl); SIRegisterTBitmap(Cl, Streams); + SIRegisterTPicture(cl); end; // PS_MINIVCL changes by Martijn Laan (mlaan at wintax _dot_ nl) diff --git a/Units/PascalScript/uPSR_extctrls.pas b/Units/PascalScript/uPSR_extctrls.pas index b653dae..78105e2 100644 --- a/Units/PascalScript/uPSR_extctrls.pas +++ b/Units/PascalScript/uPSR_extctrls.pas @@ -44,12 +44,15 @@ begin end; procedure TIMAGECANVAS_R(Self: TIMAGE; var T: TCANVAS); begin T := Self.CANVAS; end; +procedure TIMAGEPICTURE_R(Self: TIMAGE; var T: TPicture); begin T := Self.Picture; end; +procedure TIMAGEPICTURE_W(Self: TIMAGE; const T: TPicture); begin Self.Picture := t; end; procedure RIRegisterTIMAGE(Cl: TPSRuntimeClassImporter); begin with Cl.Add(TIMAGE) do begin RegisterPropertyHelper(@TIMAGECANVAS_R, nil, 'CANVAS'); + RegisterPropertyHelper(@TIMAGEPICTURE_R,@TIMAGEPICTURE_W,'PICTURE'); end; end; diff --git a/Units/PascalScript/uPSR_graphics.pas b/Units/PascalScript/uPSR_graphics.pas index df769f4..4ad4a13 100644 --- a/Units/PascalScript/uPSR_graphics.pas +++ b/Units/PascalScript/uPSR_graphics.pas @@ -14,6 +14,7 @@ procedure RIRegisterTBRUSH(Cl: TPSRuntimeClassImporter); procedure RIRegisterTCanvas(cl: TPSRuntimeClassImporter); procedure RIRegisterTGraphic(CL: TPSRuntimeClassImporter); procedure RIRegisterTBitmap(CL: TPSRuntimeClassImporter; Streams: Boolean); +procedure RIRegisterTPicture(CL: TPSRuntimeClassImporter); procedure RIRegister_Graphics(Cl: TPSRuntimeClassImporter; Streams: Boolean); @@ -203,6 +204,14 @@ begin end; end; +procedure TPictureBitmap_W(Self: TPicture; const T: TBitmap); begin Self.Bitmap := T; end; +procedure TPictureBitmap_R(Self: TPicture; var T: TBitmap); begin T := Self.Bitmap; end; +procedure RIRegisterTPicture(CL: TPSRuntimeClassImporter); +begin + with TPSRuntimeClass(CL.Add(TPicture)) do + registerPropertyHelper(@TPictureBitmap_R,@TPictureBitmap_W,'Bitmap'); +end; + procedure RIRegister_Graphics(Cl: TPSRuntimeClassImporter; Streams: Boolean); begin RIRegisterTGRAPHICSOBJECT(cl); @@ -212,6 +221,7 @@ begin RIRegisterTBRUSH(cl); RIRegisterTGraphic(CL); RIRegisterTBitmap(CL, Streams); + RIRegisterTPicture(CL); end; // PS_MINIVCL changes by Martijn Laan (mlaan at wintax _dot_ nl)