CGContext.AsBitmapContext メソッド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
CGContext を CGBitmapContext にキャストします。
public CoreGraphics.CGBitmapContext AsBitmapContext ();
member this.AsBitmapContext : unit -> CoreGraphics.CGBitmapContext
戻り値
注釈
CGContext にはさまざまな種類 (通常、ビットマップ、PDF) がありますが、Apple ではそれらを区別する方法はサポートされていません。 特定の CGContext オブジェクトは、実際には、いくつかの状況で CGBitmapContext オブジェクトであることが知られています (または BeginImageContextWithOptions(CGSize, Boolean, nfloat)を使用BeginImageContext(CGSize)してコンテキストを作成した後に を呼び出すGetImageFromCurrentImageContext())。
これらは実際には CGBitmapContext オブジェクトであり、それを変換することで、アプリケーション開発者は、その上のさまざまなビットマップ プロパティにアクセスできます。
UIGraphics.BeginImageContextWithOptions (image.Size, false, UIScreen.MainScreen.Scale);
CGBitmapContext effectInContext = UIGraphics.GetCurrentContext ().AsBitmapContext ()
// Now, you can access some interesting properties like "Data", "Width",
// "Height", "BytesPerRow" from the underlying bitmap
var effectInBuffer = new vImageBuffer () {
Data = effectInContext.Data,
Width = effectInContext.Width,
Height = effectInContext.Height,
BytesPerRow = effectInContext.BytesPerRow
};