Skip to content

How should use ID2D1RenderTarget.DrawBitmap #332

Answered by manju-summoner
qwerty1874 asked this question in Q&A
Discussion options

You must be logged in to vote

try it

using var factory = new IWICImagingFactory();
using var wicStream = factory.CreateStream(filePath, System.IO.FileAccess.Read);
using var decoder = factory.CreateDecoderFromStream(wicStream);
using var decodedFrame = decoder.GetFrame(0);
using var converter = factory.CreateFormatConverter();
converter.Initialize(decodedFrame, PixelFormat.Format32bppPBGRA, BitmapDitherType.None, null, 0, BitmapPaletteType.Custom);

var bitmap = deviceContext.CreateBitmapFromWicBitmap(converter, null);

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@qwerty1874
Comment options

@amerkoleci
Comment options

@qwerty1874
Comment options

Answer selected by amerkoleci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants