Effet Postérisation

L’effet Postérisation réduit le nombre de couleurs uniques dans une image.

Le CLSID de cet effet est CLSID _ D2D1Posterize.

Exemple d’image

exemple de sortie d’effet

Exemple de code

ComPtr<ID2D1Effect> posterizeEffect;
m_d2dContext->CreateEffect(CLSID_D2D1Posterize, &posterizeEffect);
 
posterizeEffect->SetInput(0, bitmap);
posterizeEffect->SetValue(D2D1_POSTERIZE_PROP_RED_VALUE_COUNT, 4);
posterizeEffect->SetValue(D2D1_POSTERIZE_PROP_GREEN_VALUE_COUNT, 4);
posterizeEffect->SetValue(D2D1_POSTERIZE_PROP_BLUE_VALUE_COUNT, 4);
 
m_d2dContext->BeginDraw();
m_d2dContext->DrawImage(posterizeEffect.Get());
m_d2dContext->EndDraw();


Propriétés d’effet

Les propriétés de l’effet Postérisation sont définies par l’énumération _ _ props d2d1 .

Spécifications

Condition requise Valeur
Client minimal pris en charge Windows 10 [ applications de bureau | Windows applications du windows Store]
Serveur minimal pris en charge Windows 10 [ applications de bureau | Windows applications du windows Store]
En-tête d2d1effects _ 2. h
Bibliothèque d2d1. lib, dxguid. lib