{"id":"graphics.canvas--DrawPixelsBgra8","name":"DrawPixelsBgra8","owner":"yeho","package":"graphics.canvas","kind":"function","signature":"external DrawPixelsBgra8(buffer of int pixels, int sourceWidth, int sourceHeight, int x, int y, int width, int height) returns bool","description":"Draws one bounded BGRA8 snapshot from a compute-compatible int buffer. Each value carries one packed 32-bit pixel; source dimensions are 1..2048, destination dimensions are positive logical coordinates, and the buffer count must exactly equal sourceWidth*sourceHeight. This first bridge copies into the active Canvas provider for the draw; it is deliberately not a shared GPU-resource or zero-copy contract.","context":"Draw 2D shapes, text, images, and composited interface content.","parameters":[{"name":"pixels","type":"buffer of int","description":"Supply pixels as buffer of int."},{"name":"sourceWidth","type":"int","description":"Supply source width as int."},{"name":"sourceHeight","type":"int","description":"Supply source height as int."},{"name":"x","type":"int","description":"Supply x as int."},{"name":"y","type":"int","description":"Supply y as int."},{"name":"width","type":"int","description":"Supply width as int."},{"name":"height","type":"int","description":"Supply height as int."}],"returns":"bool","members":[],"tags":["canvas","cpu","function","graphics","graphics.canvas","source-example","yeho"],"updated":"2026-09-09","source":{"repository":"yeho","path":"packages/graphics/canvas/canvas.yh","line":78,"sha256":"6ccd4ec500a65b2f8a7447e335a0f6661c8b064e12be567abc0974e818716f45"},"status":"source-declared","notes":["Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup."],"examples":[{"id":"usage","title":"Use DrawPixelsBgra8","description":"A complete small caller. Values are illustrative; check the returned result and package requirements before connecting live resources.","code":"using graphics.canvas\n\n// Draw 2D shapes, text, images, and composited interface content.\nbuffer of int pixels\npixels.Resize(8)\nint sourceWidth = 1\nint sourceHeight = 1\nint x = 1\nint y = 1\nint width = 1\nint height = 1\nbool result = DrawPixelsBgra8(pixels, sourceWidth, sourceHeight, x, y, width, height)\nConsole.Log(Text.From(result))\n","manifest":"manifestVersion = \"2\"\npackage = \"api.example.graphics_canvas__drawpixelsbgra8\"\nversion = \"0.1.0\"\nlanguageEdition = \"yeho-core-2026.1\"\n\n[app]\nkind = \"headless\"\n\n[[dependencies]]\npackage = \"graphics.canvas\"\nversion = \"0.1.0\"\npath = \"../../../yeho/packages/graphics/canvas\"\n","tags":["cpu","source-example"],"verification":"type checked","run":"cpu-oracle","sha256":"ee36efed7b4b7ad047b5c54a4332c7b17ff79ee04c827d991eac362a38cee346","checked":"2026-09-09","diagnostic":"","observedOutput":null,"checkedBackend":null}],"searchTerms":[],"url":"https://demonhunterlabs.com/academy/api?item=graphics.canvas--DrawPixelsBgra8","json":"https://demonhunterlabs.com/reference/items/graphics.canvas--DrawPixelsBgra8.json","markdown":"https://demonhunterlabs.com/reference/text/graphics.canvas--DrawPixelsBgra8.md"}
