Environment.DrawImage Method

Draws an image on the Environment's client area.
Protected Friend Sub DrawImage( _ 
ByVal x As Integer, _ 
ByVal y As Integer, _ 
ByVal image As Bitmap
)
This language is not supported or no code example is available.
internal protected void DrawImage( 
int x
int y
Bitmap image 
)
This language is not supported or no code example is available.

Parameters

x
int

The image's x corrdinate

y
int

The image's y coordinate (from the bottom of the viewport)

image
Bitmap

The image to draw

Remarks
 
Alpha channel is supported. Use the RotateFlip method to flip the image upside down.
Example
 
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.

.NET Framework

Supported in: 4.5, 4.6, 4.7

In this article

Definition