From baf7cd3182e2cd72ccb9fdaced179ee8b1054447 Mon Sep 17 00:00:00 2001 From: Chris Rorden Date: Thu, 22 Jun 2017 10:12:12 -0400 Subject: [PATCH] Restore Delphi compatibility --- README.md | 3 ++- mainunit.pas | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index eb21eb6..c44dbb5 100755 --- a/README.md +++ b/README.md @@ -10,10 +10,11 @@ http://www.mccauslandcenter.sc.edu/mricrogl/ ##### Recent Versions -16-June-2017 +21-June-2017 - Preferences window now allows user to enable optional support for MacOS retina resolution. Slower but better quality. - [Screenshot fixes](http://www.nitrc.org/forum/message.php?msg_id=21504). Fix 'seams' when taking screenshots with high zoom factors, reduce blurriness of mosaic screenshots. - New script commands "sharpen" and "bmpzoom" (described in manual). + - Better support for NRRD format images. 28-May-2017 - [Better thresholding of binary overlays](https://www.nitrc.org/forum/message.php?msg_id=19974). diff --git a/mainunit.pas b/mainunit.pas index 589b1df..ecdc823 100755 --- a/mainunit.pas +++ b/mainunit.pas @@ -979,8 +979,8 @@ function TGLForm1.ScreenShot(Zoom: integer): TBitmap; begin gRayCast.ScreenCapture := true; GLBox.MakeCurrent; - w := GLBox.BackingWidth; - h := GLbox.BackingHeight; + w := GLBox.Width; + h := GLbox.Height; wz := w*Zoom; hz := h*Zoom; Result:=TBitmap.Create; @@ -992,7 +992,7 @@ function TGLForm1.ScreenShot(Zoom: integer): TBitmap; for tile := 0 to ((Zoom * Zoom) - 1) do begin tilex := (tile mod zoom) * w; tiley := (tile div zoom) * h; - DisplayGLz(gTexture3D, Zoom, -tilex, -tiley); + DisplayGLz(gTexture3D, Zoom, -tilex, -tiley,0); glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, @p[0]); z := 0; for y:=0 to h-1 do begin @@ -2391,7 +2391,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+' 16 June 2017' + str := 'MRIcroGL '+str+' 21 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)