Skip to content

Latest commit

 

History

History
106 lines (83 loc) · 3.02 KB

nf-gdiplusheaders-bitmap-applyeffect(effect_rect).md

File metadata and controls

106 lines (83 loc) · 3.02 KB
UID title description tech.root helpviewer_keywords ms.assetid ms.date ms.keywords targetos req.assembly req.construct-type req.ddi-compliance req.dll req.header req.idl req.include-header req.irql req.kmdf-ver req.lib req.max-support req.namespace req.redist req.target-min-winverclnt req.target-min-winversvr req.target-type req.type-library req.umdf-ver req.unicode-ansi f1_keywords dev_langs topic_type api_type api_location api_name
NF:gdiplusheaders.Bitmap.ApplyEffect(Effect,RECT)
Bitmap::ApplyEffect
The Bitmap::ApplyEffect method alters this Bitmap object by applying a specified effect.
gdiplus
Bitmap::ApplyEffect
fff2c151-92df-477e-aafd-6aaca27df414
05/20/2019
Bitmap::ApplyEffect
Windows
function
gdiplusheaders.h
Bitmap::ApplyEffect
gdiplusheaders/Bitmap::ApplyEffect
c++
apiref
COM
gdiplusheaders.h
Bitmap::ApplyEffect

ApplyEffect(Effect*,RECT*)

-description

The Bitmap::ApplyEffect method alters this Bitmap object by applying a specified effect.

-parameters

-param effect

Pointer to an instance of a descendant of the Effect class. The descendant (for example, a Blur object) specifies the effect that is applied.

-param ROI

Pointer to a RECT structure that specifies the portion of the input bitmap to which the effect is applied. Pass NULL to specify that the effect applies to the entire input bitmap.

-returns

Type: Status

If the method succeeds, it returns Ok, which is an element of the Status enumeration.

If the method fails, it returns one of the other elements of the Status enumeration.

-remarks

Examples

The following example draws an image twice: once with no change, and once after the brightness has been increased for part of the image.

VOID Example_BrightnessContrastApplyEffect1(HDC hdc)
{
   Graphics graphics(hdc);
   Bitmap myBitmap(L"Picture.bmp");
   UINT srcWidth = myBitmap.GetWidth();
   UINT srcHeight = myBitmap.GetHeight();

   BrightnessContrastParams briConParams;
   briConParams.brightnessLevel = 50;
   briConParams.contrastLevel = 0;
   BrightnessContrast briCon;
   briCon.SetParameters(&briConParams);
   RECT rectOfInterest = {20, 15, 80, 50};

   // Draw the original image.
   graphics.DrawImage(&myBitmap, 20, 20, srcWidth, srcHeight);

   // Increase the brightness in a portion of the image.
   myBitmap.ApplyEffect(&briCon, &rectOfInterest);

   // Draw the image again.
   graphics.DrawImage(&myBitmap, 200, 20, srcWidth, srcHeight);
}

-see-also

Bitmap