---
title: "AviCustomTransition..::.OnDrawTransition Method "
canonical: https://www.graphicsmill.com/docs/gm5/M_Aurigma_GraphicsMill_Codecs_AviCustomTransition_OnDrawTransition_5_77f8c163.htm
product: "Graphics Mill 5.5 for .NET"
---

This documentation is for the old version. [Go to the latest Graphics Mill docs](https://www.graphicsmill.com/docs/gm/)

# AviCustomTransition.OnDrawTransition Method 
 
This method is called each time when it is necessary to generate new frame. You should override it to create a custom transition effect.
 
**Namespace:** [Aurigma.GraphicsMill.Codecs](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
 **Assembly:** Aurigma.GraphicsMill.Codecs.AviProcessor (in Aurigma.GraphicsMill.Codecs.AviProcessor.dll)
 
## Syntax
  
```
Public Overridable Sub OnDrawTransition ( _previousBitmap As Bitmap, _resultBitmap As Bitmap, _nextBitmap As Bitmap, _intermediateFrameIndex As Integer, _intermediateFrameCount As Integer _
)
```
 
```csharp
public virtual void OnDrawTransition(Bitmap previousBitmap,Bitmap resultBitmap,Bitmap nextBitmap,int intermediateFrameIndex,int intermediateFrameCount
)
```
 
### Parameters
 
 - previousBitmap
     - Type: [Aurigma.GraphicsMill.Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
 [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md) object which specifies the previous key frame.

 - resultBitmap
     - Type: [Aurigma.GraphicsMill.Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
 [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md) object which should contain the result. This bitmap already has the necessary size and there is no need to reinitialize it. You should draw the result of *previousBitmap* and *nextBitmap* combine.

 - nextBitmap
     - Type: [Aurigma.GraphicsMill.Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md)
 [Bitmap](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Bitmap.htm.md) object which specifies the next key frame.

 - intermediateFrameIndex
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
An index of the current intermediate frame.

 - intermediateFrameCount
     - Type: [System.Int32](http://msdn2.microsoft.com/en-us/td2s409d)
Total count of intermediate frames.
 
## Remarks
  
To implement your custom transition you should override this method. Use *intermediateFrameIndex* and *intermediateFrameCount* to calculate the degree of the next frame domination (e.g. you can use it as opacity of the next frame). After that combine the *previousBitmap* and *nextBitmap* in the way you need and draw the result to the *resultBitmap*.
 
No need to call this method directly.
   
## See Also

### Reference

- [AviCustomTransition Class](https://www.graphicsmill.com/docs/gm5/T_Aurigma_GraphicsMill_Codecs_AviCustomTransition.htm.md)
- [Aurigma.GraphicsMill.Codecs Namespace](https://www.graphicsmill.com/docs/gm5/N_Aurigma_GraphicsMill_Codecs.htm.md)
