Skip to content

Commit

Permalink
Windows HiDPI tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Jul 12, 2017
1 parent ca0dc0e commit b947cf4
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 85 deletions.
9 changes: 5 additions & 4 deletions _delphizip.bat
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
REM copy latest version of dcm2niix
cd c:\dcm2niix\console
g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp -s -o dcm2niix -static-libgcc
copy c:\dcm2niix\console\dcm2niix.exe c:\mricrogl\dcm2niix.exe
REM cd c:\dcm2niix\console
REM g++ -O3 -DmyDisableOpenJPEG -I. main_console.cpp nii_dicom.cpp nifti1_io_core.cpp nii_ortho.cpp nii_dicom_batch.cpp jpg_0XC3.cpp ujpeg.cpp -s -o dcm2niix -static-libgcc
REM copy c:\dcm2niix\console\dcm2niix.exe c:\mricrogl\dcm2niix.exe

REM COMPILE MRIcroGL
cd c:\pas\MRIcroGL
c:\lazarus\lazbuild --cpu=x86_64 -B simplelaz.lpi
move /Y "C:\pas\MRIcroGL\MRIcroGL.exe" "c:\mricrogl\MRIcroGL64.exe"

C:\PROGRA~2\BORLAND\DELPHI7\BIN\dcc32 -UC:\pas\FastMM;C:\pas\pascalscript\Source;C:\pas\MRIcroGL\pngimg;C:\pas\MRIcroGL\delphionly -B C:\pas\MRIcroGL\simple.dpr
cd c:\pas\MRIcroGL
C:\PROGRA~2\BORLAND\DELPHI7\BIN\dcc32 -UC:\pas\FastMM;c:\pas\PngComponents\Source;C:\pas\pascalscript\Source;C:\pas\delphionly -B C:\pas\MRIcroGL\simple.dpr
c:\strip /B "C:\pas\MRIcroGL\simple.exe"
move /Y "C:\pas\MRIcroGL\simple.exe" "c:\mricrogl\MRIcroGL.exe"
REM copy new compilation to server
Expand Down
24 changes: 12 additions & 12 deletions mainunit.lfm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object GLForm1: TGLForm1
Width = 214
Align = alTop
Caption = 'Clipping'
ClientHeight = 69
ClientHeight = 70
ClientWidth = 206
ParentFont = False
TabOrder = 0
Expand Down Expand Up @@ -109,14 +109,14 @@ object GLForm1: TGLForm1
Width = 214
Align = alClient
Caption = 'Shader'
ClientHeight = 175
ClientHeight = 176
ClientWidth = 206
ParentFont = False
TabOrder = 1
OnResize = ShaderBoxResize
object ShaderMemo: TMemo
Left = 0
Height = 55
Height = 56
Top = 120
Width = 206
Align = alClient
Expand Down Expand Up @@ -747,7 +747,7 @@ object GLForm1: TGLForm1
Width = 214
Align = alTop
Caption = 'Intensity Minimum..Maximum'
ClientHeight = 27
ClientHeight = 28
ClientWidth = 206
ParentFont = False
TabOrder = 2
Expand Down Expand Up @@ -782,7 +782,7 @@ object GLForm1: TGLForm1
Width = 214
Align = alTop
Caption = 'Cutout'
ClientHeight = 69
ClientHeight = 70
ClientWidth = 206
ParentFont = False
TabOrder = 3
Expand Down Expand Up @@ -913,14 +913,14 @@ object GLForm1: TGLForm1
Width = 214
Align = alTop
Caption = 'Mosaic'
ClientHeight = 236
ClientHeight = 237
ClientWidth = 206
ParentFont = False
TabOrder = 5
Visible = False
object MosaicText: TMemo
Left = 0
Height = 120
Height = 121
Top = 116
Width = 206
Align = alClient
Expand Down Expand Up @@ -1031,7 +1031,7 @@ object GLForm1: TGLForm1
Left = 3
Height = 18
Top = 70
Width = 88
Width = 87
Caption = 'Cross slice'
OnChange = UpdateMosaic
TabOrder = 5
Expand All @@ -1058,7 +1058,7 @@ object GLForm1: TGLForm1
Left = 104
Height = 18
Top = 70
Width = 93
Width = 91
Caption = 'Label slices'
OnChange = UpdateMosaic
TabOrder = 8
Expand All @@ -1072,14 +1072,14 @@ object GLForm1: TGLForm1
Width = 214
Align = alTop
Caption = 'Overlays'
ClientHeight = 51
ClientHeight = 52
ClientWidth = 206
ParentFont = False
TabOrder = 6
Visible = False
object StringGrid1: TStringGrid
Left = 0
Height = 51
Height = 52
Top = 0
Width = 206
Align = alClient
Expand Down Expand Up @@ -1141,7 +1141,7 @@ object GLForm1: TGLForm1
Width = 214
Align = alTop
Caption = '2D Slices'
ClientHeight = 65
ClientHeight = 66
ClientWidth = 206
ParentFont = False
TabOrder = 8
Expand Down
18 changes: 8 additions & 10 deletions mainunit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1943,20 +1943,16 @@ procedure TGLForm1.OverlayBoxCreate;
InitOverlays;
InterpolateMenu.checked := gPrefs.InterpolateOverlays;
OverlayColorFromZeroMenu.checked := gPrefs.OverlayColorFromZero;
// for i := 1 to StringGrid1.RowCount-1 do
// StringGrid1.Cells[kFName, i] := IntToStr(i);
SetSubmenuWithTag(Onotheroverlays1,gPrefs.OverlayAlpha);
SetOverlayAlphaValue( gPrefs.OverlayAlpha);
SetBackgroundAlphaValue( gPrefs.BackgroundAlpha);
SetSubmenuWithTag(Onbackground1,gPrefs.BackgroundAlpha);
StringGrid1.Selection := TGridRect(Rect(-1, -1, -1, -1));
StringGrid1.DefaultRowHeight := LUTdrop.Height+1;
StringGrid1.DefaultColWidth := (StringGrid1.width div 4)-2;
{$IFDEF FPC} {$IFNDEF UNIX}
if Screen.PixelsPerInch <> 96 then begin
StringGrid1.DefaultColWidth := round(StringGrid1.width* (Screen.PixelsPerInch/96) * 0.25) - 2;
//ClipBox.Caption := INTTOSTR(Screen.PixelsPerInch)+' '+ inttostr(FormWidth)+'x'+inttostr(FormHeight)+' '+inttostr(lVidx)+'x'+inttostr(lVidY);
end;
{$IFDEF FPC} {$IFNDEF UNIX} //removed July 2017: Lazarus 1.8 repainting issues?
//if Screen.PixelsPerInch <> 96 then
// StringGrid1.DefaultColWidth := round(StringGrid1.width* (Screen.PixelsPerInch/96) * 0.25) - 2;
{$ENDIF}{$ENDIF}
//{$ENDIF}
//LUTdrop.Visible := False;
Expand Down Expand Up @@ -1987,7 +1983,7 @@ procedure TGLForm1.FormCreate(Sender: TObject);
{$IFDEF FPC} Application.ShowButtonGlyphs:= sbgNever; {$ENDIF}
forceReset := false;
gPrefs.InitScript := '';
i := 1;
i := 1; f
while i <= ParamCount do begin
s := ParamStr(i);
if (length(s)> 1) and (s[1]='-') then begin
Expand Down Expand Up @@ -2622,7 +2618,7 @@ procedure TGLForm1.About1Click(Sender: TObject);
{$IFDEF LCLCocoa}str := str + ' (Cocoa) '; {$ENDIF}
{$IFDEF LCLCarbon}str := str + ' (Carbon) '; {$ENDIF}
{$IFDEF DGL} str := str +' (DGL) '; {$ENDIF}//the DGL library has more dependencies - report this if incompatibilities are found
str := 'MRIcroGL '+str+' 21 June 2017'
str := 'MRIcroGL '+str+' 24 June 2017'
+kCR+' www.mricro.com :: BSD 2-Clause License (opensource.org/licenses/BSD-2-Clause)'
+kCR+' Dimensions '+inttostr(gTexture3D.NIFTIhdr.dim[1])+'x'+inttostr(gTexture3D.NIFTIhdr.dim[2])+'x'+inttostr(gTexture3D.NIFTIhdr.dim[3])
+kCR+' Bytes per voxel '+inttostr(gTexture3D.NIFTIhdr.bitpix div 8)
Expand Down Expand Up @@ -4147,7 +4143,9 @@ procedure TGLForm1.UpdateImageIntensityMinMax (lOverlay: integer; lMinIn,lMaxIn:

procedure TGLForm1.ChangeOverlayUpdate;
begin

{$IFDEF FPC}{$IFDEF Windows} //July2017: Lazarus 1.8.0 does not repaint?
StringGrid1.Refresh;
{$ENDIF}{$ENDIF}
M_Refresh := true;
// deleteGradients(gTexture3D);
GLForm1.UpdateTimer.enabled := true;
Expand Down
Loading

0 comments on commit b947cf4

Please sign in to comment.