# Texture

class `cee.``Texture`()

  Factory for creating texture objects

Methods

- `fromHTMLImageElement`
- `fromImageData`

## Methods

### static fromHTMLImageElement

`Texture.``fromHTMLImageElement`(htmlImageElement[, textureOptions])

  Arguments: | htmlImageElement (`HTMLImageElement`) – None textureOptions (`TextureOptions`) – optional None

  Creates a texture image object from an HTMLImageElement

  Note: A general rule is that both dimensions must be a power of two.

  To avoid this limitation, pass in texture options with generateMipmaps set to false, wrapMode set to TextureWrapMode.CLAMP_TO_EDGE and minFilter set to LINEAR or NEAREST. E.g.:

      const texture = cee.Texture.fromImageData(imageData,
          { generateMipmaps: false,
            wrapMode: cee.TextureWrapMode.CLAMP_TO_EDGE,
            minFilter: cee.TextureMinFilter.LINEAR
          });

  Return type: | Texture

### static fromImageData

`Texture.``fromImageData`(imageData[, textureOptions])

  Arguments: | imageData (`ImageData`) – None textureOptions (`TextureOptions`) – optional None

  Creates a texture image object from ImageData

  Note: A general rule is that both dimensions must be a power of two.

  To avoid this limitation, pass in texture options with generateMipmaps set to false, wrapMode set to TextureWrapMode.CLAMP_TO_EDGE and minFilter set to LINEAR or NEAREST. E.g.:

      const texture = cee.Texture.fromImageData(imageData,
          { generateMipmaps: false,
            wrapMode: cee.TextureWrapMode.CLAMP_TO_EDGE,
            minFilter: cee.TextureMinFilter.LINEAR
          });

  Return type: | Texture

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your multilingual generative AI assistant for documentation. Ask me anything about HOOPS Envision for Web in your own language, or choose a sample question below to start a conversation:

What is HOOPS Envision for Web?
What are the latest release notes for HOOPS Envision for Web?
How do I start evaluating HOOPS Envision for Web?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...