Skip to main content
IDCompositionVirtualSurface::Resize method

Changes the logical size of this virtual surface object.

Syntax


HRESULT Resize(
  [in]  UINT width,
  [in]  UINT height
);

Parameters

width [in]

Type: UINT

The new width of the virtual surface, in pixels. The maximum width is 16,777,216 pixels.

height [in]

Type: UINT

The new height of the virtual surface, in pixels. The maximum height is 16,777,216 pixels.

Return value

Type: HRESULT

If the function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. See DirectComposition Error Codes for a list of error codes.

Remarks

When a virtual surface is resized, its contents are preserved up to the new boundaries of the surface. If the surface is made smaller, any previously allocated pixels that fall outside of the new width or height are discarded.

This method fails if IDCompositionSurface::BeginDraw was called for this bitmap without a corresponding call to IDCompositionSurface::EndDraw.

This method fails if width or height exceeds 16,777,216 pixels.

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Dcomp.h

Library

Dcomp.lib

DLL

Dcomp.dll

See also

IDCompositionDevice::CreateVirtualSurface
IDCompositionVirtualSurface
IDCompositionVirtualSurface::Trim