Skip to content
Discussion options

You must be logged in to vote

@Gavin-Williams i use a load into a bitmap then translate the bitmap data to the format in Texture2d, Can dump code here (it's a bit verbose though)

This function is what im currently using, its a little inefficient but its a cut over from sharpdx days. Takes care of whether you want to create autogen mip maps

`
public static ID3D11Texture2D CreateTex2DFromBitmap(System.Drawing.Bitmap bsource, D3D11.ID3D11Device1 d3dDevice, D3D11.Texture2DDescription textureDesc)
{
ID3D11Texture2D t2d_ = null;

        try
        {
            int stride_ = bsource.Size.Width * 4;
            var buffer_ = new DataStream(bsource.Size.Height * stride_, true, true);

            if (textureDesc.MipLevels !=…

Replies: 4 comments 27 replies

Comment options

You must be logged in to vote
16 replies
@Gavin-Williams
Comment options

@Gavin-Williams
Comment options

@Gavin-Williams
Comment options

@Gavin-Williams
Comment options

@Kharzette
Comment options

Comment options

You must be logged in to vote
6 replies
@Gavin-Williams
Comment options

@h1cks
Comment options

@h1cks
Comment options

@h1cks
Comment options

@h1cks
Comment options

Answer selected by Gavin-Williams
Comment options

You must be logged in to vote
3 replies
@Gavin-Williams
Comment options

@h1cks
Comment options

@amerkoleci
Comment options

Comment options

You must be logged in to vote
2 replies
@amerkoleci
Comment options

@bforl
Comment options

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