Raw data from image


#1

This question might be confusing and not make sense. Is there any way in the Ruby API to read raw data from an image and make a texture from that?


#2

have you looked at the API for material?

 model = Sketchup.active_model
 materials = model.materials
 material = materials.add('Joe')
 material.texture = "C:/Materials/Carpet.jpg"

the path can be to any supported raster image file…

john


#3

The API doesn’t have anything to manipulate raw image data. If you do have raw image data from some source you’d have to write it out to a file and use that to create a new Texture object like John demonstrated with material.texture=.


#4

Ok. Thank you for the response.