Changeset 347 for trunk/Packages/CevoComponents
- Timestamp:
- Apr 6, 2021, 7:39:39 PM (4 years ago)
- Location:
- trunk/Packages/CevoComponents
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/DrawDlg.pas
r336 r347 23 23 // defines area to grip the window for moving (from top) 24 24 procedure InitButtons; 25 procedure OnEraseBkgnd(var m: TMessage); message WM_ERASEBKGND;25 procedure OnEraseBkgnd(var Msg: TMessage); message WM_ERASEBKGND; 26 26 procedure OnHitTest(var Msg: TMessage); message WM_NCHITTEST; 27 27 procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); … … 84 84 end; 85 85 86 procedure TDrawDlg.OnEraseBkgnd(var m: TMessage);86 procedure TDrawDlg.OnEraseBkgnd(var Msg: TMessage); 87 87 begin 88 88 // Full area should be covered by Paint method … … 118 118 end; 119 119 end; 120 Msg.Result := HTCAPTION 120 Msg.Result := HTCAPTION; 121 121 end; 122 122 end; -
trunk/Packages/CevoComponents/ScreenTools.pas
r331 r347 1035 1035 procedure InitOrnament; 1036 1036 var 1037 x, y, p, Light, Shade: Integer; 1037 P: TColor; 1038 X, Y: Integer; 1039 Light, Shade: TColor32; 1040 PixelPtr: TPixelPointer; 1038 1041 begin 1039 1042 if InitOrnamentDone then Exit; 1040 Light := MainTexture.clBevelLight;1043 Light := ColorToColor32(MainTexture.clBevelLight); 1041 1044 // and $FCFCFC shr 2*3+MainTexture.clBevelShade and $FCFCFC shr 2; 1042 Shade := MainTexture.clBevelShade and $FCFCFC shr 2 * 3 + 1043 MainTexture.clBevelLight and $FCFCFC shr 2; 1044 for x := 0 to Ornament.Width - 1 do 1045 for y := 0 to Ornament.Height - 1 do begin 1046 p := HGrSystem2.Data.Canvas.Pixels[Ornament.Left + x, Ornament.Top + y]; 1047 if p = $0000FF then 1048 HGrSystem2.Data.Canvas.Pixels[Ornament.Left + x, Ornament.Top + y] := Light 1049 else if p = $FF0000 then 1050 HGrSystem2.Data.Canvas.Pixels[Ornament.Left + x, Ornament.Top + y] := Shade; 1051 end; 1045 Shade := ColorToColor32(MainTexture.clBevelShade and $FCFCFC shr 2 * 3 + 1046 MainTexture.clBevelLight and $FCFCFC shr 2); 1047 HGrSystem2.Data.BeginUpdate; 1048 PixelPtr := PixelPointer(HGrSystem2.Data, ScaleToNative(Ornament.Left), ScaleToNative(Ornament.Top)); 1049 if PixelPtr.BytesPerPixel = 3 then begin 1050 for Y := 0 to ScaleToNative(Ornament.Height) - 1 do begin 1051 for X := 0 to ScaleToNative(Ornament.Width) - 1 do begin 1052 P := Color32ToColor(PixelPtr.Pixel^.RGB); 1053 if P = $0000FF then PixelPtr.Pixel^.RGB := Light 1054 else if P = $FF0000 then PixelPtr.Pixel^.RGB := Shade; 1055 PixelPtr.NextPixel; 1056 end; 1057 PixelPtr.NextLine; 1058 end; 1059 end else begin 1060 for Y := 0 to ScaleToNative(Ornament.Height) - 1 do begin 1061 for X := 0 to ScaleToNative(Ornament.Width) - 1 do begin 1062 P := Color32ToColor(PixelPtr.Pixel^.ARGB); 1063 if P = $0000FF then PixelPtr.Pixel^.ARGB := Light 1064 else if P = $FF0000 then PixelPtr.Pixel^.ARGB := Shade; 1065 PixelPtr.NextPixel; 1066 end; 1067 PixelPtr.NextLine; 1068 end; 1069 end; 1052 1070 InitOrnamentDone := True; 1071 HGrSystem2.Data.EndUpdate; 1053 1072 end; 1054 1073 -
trunk/Packages/CevoComponents/Sound.pas
r317 r347 19 19 {$IFDEF WINDOWS} 20 20 PrevWndProc: WNDPROC; 21 procedure OnMCI(var m: TMessage); message MM_MCINOTIFY;21 procedure OnMCI(var Msg: TMessage); message MM_MCINOTIFY; 22 22 public 23 23 constructor Create(AOwner: TComponent); override; … … 255 255 end; 256 256 257 procedure TSoundPlayer.OnMCI(var m: TMessage);258 begin 259 if ( m.wParam = MCI_NOTIFY_SUCCESSFUL) and (PlayingSound <> nil) then257 procedure TSoundPlayer.OnMCI(var Msg: TMessage); 258 begin 259 if (Msg.wParam = MCI_NOTIFY_SUCCESSFUL) and (PlayingSound <> nil) then 260 260 begin 261 261 PlayingSound.Reset; -
trunk/Packages/CevoComponents/UPixelPointer.pas
r331 r347 46 46 function PixelPointer(Bitmap: TRasterImage; BaseX: Integer = 0; BaseY: Integer = 0): TPixelPointer; inline; 47 47 function SwapRedBlue(Color: TColor32): TColor32; 48 function Color32ToColor(Color: TColor32): TColor; 49 function ColorToColor32(Color: TColor): TColor32; 48 50 49 51 implementation … … 113 115 end; 114 116 117 function Color32ToColor(Color: TColor32): TColor; 118 begin 119 Result := ((Color shr 16) and $ff) or (Color and $00ff00) or 120 ((Color and $ff) shl 16); 121 end; 122 123 function ColorToColor32(Color: TColor): TColor32; 124 begin 125 Result := $ff000000 or ((Color shr 16) and $ff) or (Color and $00ff00) or 126 ((Color and $ff) shl 16); 127 end; 115 128 116 129 end.
Note:
See TracChangeset
for help on using the changeset viewer.