user2170124
user2170124

Reputation: 105

DirectWrite: How to get rendered bitmap data

Is there a way to get rendered bitmap image using DirectWrite and Direct2D ?

Like FreeType2's FT_GlyphSlot->bitmap...

Upvotes: 1

Views: 1332

Answers (2)

bunglehead
bunglehead

Reputation: 1179

It is possible, and you don't need to use Direct2D for that. Use CreateGlyphRunAnalysis and then call GetAlphaTextureBounds to get resulting bitmap bounds, then allocated buffer and call CreateAlphaTexture. This fills your buffer with opacity mask for a glyph run you want to render.

Upvotes: 2

zdd
zdd

Reputation: 8747

I think you can create a ID2D1Bitmap first, then use ID2D1Bitmap::CopyFromRenderTarget to copy the data from render target.

Upvotes: 1

Related Questions