d2dx icon indicating copy to clipboard operation
d2dx copied to clipboard

Can't Take Screenshots?

Open whipowill opened this issue 3 years ago • 11 comments

Can't take a screenshot? No screenshot files are created when I press the screenshot button.

whipowill avatar Jul 15 '21 19:07 whipowill

Can't take a screenshot? No screenshot files are created when I press the screenshot button.

working fine with me what diablo 2 version are you using?

MAXBURAOT avatar Aug 07 '21 13:08 MAXBURAOT

Hi, I just tested 1.13d + D2DX 0.99.529 and PrintScreen keyboard button doesn't seem to take screenshots for me either. (D2 usually saves screenies to the game folder right ?)

eleriaqueen avatar Aug 29 '21 19:08 eleriaqueen

If this helps, in my case I am running 1.14d with PlugY 14.03 on a Win7 64 Ultimate. Tried both F12 and PrintScreen in controls and there are no screenshots saved anywhere (in directory or [username]/Saved Games/Diablo II)

oGkspAz avatar Sep 16 '21 19:09 oGkspAz

Are you running PlugY?

If so, do not run plugy with the -3dfx flag in the shortcut. Instead, go into the PlugY.ini file and use this line to launch it.

[LAUNCHING] Param=-3dfx Library=PlugY.dll

That fixed the screenshot error for me.

jrt05 avatar Oct 08 '21 15:10 jrt05

I just tested on a new install (copied D2 {1.14d} into new folder, copied d2dx in, copied PlugY {v14.03) in. added -3dfx to param as above instead. Still no luck. Also tried running on my D2 with BaseMod and that doesn't even recognise the -3dfx in param. Edit: Same thing happens running plain D2 with d2dx, with the command line in shortcut of course.

oGkspAz avatar Oct 08 '21 15:10 oGkspAz

That was going to be my next check to see if it works with plain D2.

The wrapper and everything works with plain D2, just no screenshot? Strange. And your shortcut looks like the following?

image

jrt05 avatar Oct 08 '21 15:10 jrt05

Yep. It had -w too but I just removed that and tested again just in case. Same result. Are you running 1.14d as well or an earlier version?

oGkspAz avatar Oct 08 '21 15:10 oGkspAz

Yeah, I'm running 1.14d. I installed using the blizzard installer (which installed something like 1.14b), and used the patch to upgrade to 1.14d.

I also installed plugy using the installer, so PlugY is in its own directory.

jrt05 avatar Oct 08 '21 15:10 jrt05

This is my d2dx.cfg if that helps.

[window] scale=1 # range 1-3, an integer scale factor for the window position=[-1,-1] # if [-1,-1] the window will be centered, otherwise placed at the explicit position given here frameless=false # if true, the window frame (caption bar etc) will be removed

[game] size=[-1,-1] # if [-1,-1] d2dx will decide a suitable game size, otherwise will use the size given here filtering=2 # if 0, will use high quality filtering (sharp, more pixelated) # 1, will use bilinear filtering (blurry) # 2, will use catmull-rom filtering (higher quality than bilinear)

[optouts] noclipcursor=false # if true, will not lock the mouse cursor to the game window nofpsfix=true # if true, will not apply the basic fps fix (precludes high fps support) noresmod=true # if true, will not apply the built-in D2HD resolution mod (precludes widescreen support) nowide=false # if true, will not choose a widescreen resolution (if noresmod is true, this does nothing) nologo=true # if true, will not display the D2DX logo on the title screen novsync=false # if true, will not use vertical sync noaa=false # if true, will not apply anti-aliasing to jagged edges nocompatmodefix=false # if true, will not block the use of "Windows XP compatibility mode" notitlechange=false # if true, will not change the window title text nomotionprediction=true # if true, will not run the game graphics at high fps

jrt05 avatar Oct 08 '21 15:10 jrt05

Same issue on Windows 7 Pro 64 bit. Hitting print screen, which is bound to screen shot, does not write a screenshot to the game directory. Using 1.13d with basemod and BH Maphack and the uber tristram minion fix.

Avder42 avatar Oct 18 '21 04:10 Avder42

I've had a quick look at D2DX source code and it doesn't seem to handle screenshots currently.

There's a func that handles alt+enter, mouse movement, etc... and there's no special case for printscreen.

static LRESULT CALLBACK d2dxSubclassWndProc(
	HWND hWnd,
	UINT uMsg,
	WPARAM wParam,
	LPARAM lParam,
	UINT_PTR uIdSubclass,
	DWORD_PTR dwRefData)
{
	RenderContext* renderContext = (RenderContext*)dwRefData;

	if (uMsg == WM_ACTIVATEAPP)
	{
		if (wParam)
		{
			renderContext->ClipCursor();
		}
		else
		{
			renderContext->UnclipCursor();
		}
	}
	else if (uMsg == WM_SYSKEYDOWN || uMsg == WM_KEYDOWN)
	{
		if (wParam == VK_RETURN && (HIWORD(lParam) & KF_ALTDOWN))
		{
			renderContext->ToggleFullscreen();
			return 0;
		}
	}
	else if (uMsg == WM_DESTROY)
	{
		RemoveWindowSubclass(hWnd, d2dxSubclassWndProc, 1234);
		D2DXContextFactory::DestroyInstance();
	}
	else if (uMsg == WM_NCMOUSEMOVE)
	{
		ShowCursor_Real(TRUE);
		return 0;
	}
	else if (uMsg >= WM_MOUSEFIRST && uMsg <= WM_MOUSELAST)
	{
#ifdef NDEBUG
		ShowCursor_Real(FALSE);
#endif
		Offset mousePos = { LOWORD(lParam), HIWORD(lParam) };

		Size gameSize;
		Rect renderRect;
		Size desktopSize;
		renderContext->GetCurrentMetrics(&gameSize, &renderRect, &desktopSize);
		const bool isFullscreen = renderContext->GetScreenMode() == ScreenMode::FullscreenDefault;
		const float scale = (float)renderRect.size.height / gameSize.height;
		const uint32_t scaledWidth = (uint32_t)(scale * gameSize.width);
		const float mouseOffsetX = isFullscreen ? (float)(desktopSize.width / 2 - scaledWidth / 2) : 0.0f;

		mousePos.x = (int32_t)(max(0, mousePos.x - mouseOffsetX) / scale);
		mousePos.y = (int32_t)(mousePos.y / scale);

		lParam = mousePos.x;
		lParam |= mousePos.y << 16;
	}

	return DefSubclassProc(hWnd, uMsg, wParam, lParam);
}

That being said, there's a workaround as the PrintScreen key seems to trigger a "windows screenshot" which is sent to the clipboard, So just hit PrintScreen in game, then fire up GIMP or ms paint and Paste (CTRL + V) and you'll have your screenshot, no ideal but serviceable...

eleriaqueen avatar Oct 01 '22 14:10 eleriaqueen