Environment.DrawImage Method
Alpha channel is supported. Use the RotateFlip method to flip the image upside down.
The following code demonstrates how to efficiently draw an image on screen
private TextureBase texture1; private bool firstTime = false; protected override void DrawOverlay(DrawSceneParams data) { base.DrawOverlay(data); if (!firstTime) { firstTime = true; texture1 = renderContext.CreateTexture2D(Properties.Resources.Smiley, textureFilteringFunctionType.Nearest, textureFilteringFunctionType.Nearest, true, true); font.Dispose(); } DrawTexture(texture1, 100, 100, ContentAlignment.BottomLeft); // Remember to Dispose the texture when it is no more needed, or before quitting the application }
This language is not supported or no code example is available.
Private texture1 As TextureBase Private firstTime As Boolean = False Protected Overrides Sub DrawOverlay(data As DrawSceneParams) MyBase.DrawOverlay(data) If Not firstTime Then firstTime = True texture1 = renderContext.CreateTexture2D(Properties.Resources.Smiley, textureFilteringFunctionType.Nearest, textureFilteringFunctionType.Nearest, True, True) font.Dispose() End If DrawTexture(texture1, 100, 100, ContentAlignment.BottomLeft) ' Remember to Dispose the texture when it is no more needed, or before quitting the application End Sub
This language is not supported or no code example is available.