Efek posterisasi

Efek posterize mengurangi jumlah warna unik dalam gambar.

CLSID untuk efek ini CLSID_D2D1Posterize.

Contoh gambar

contoh output efek

Kode sampel

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();


Properti efek

Properti untuk efek posterize ditentukan oleh enumerasi D2D1_POSTERIZE_PROP .

Persyaratan

Persyaratan Nilai
Klien minimum yang didukung Windows 10 [aplikasi desktop | Aplikasi Bursa Windows]
Server minimum yang didukung Windows 10 [aplikasi desktop | Aplikasi Bursa Windows]
Header d2d1effects_2.h
Pustaka d2d1.lib, dxguid.lib