PDA

View Full Version : Extract height and width of a bitmap


Jor-Art
10-29-2010, 11:51 AM
Is it possible to extract the height and width of a bitmap using COFFEE?

I need this to automatic set de height and width of a Plane with the dimensions of a bitmap .

It would be great if this could work.

Jörg

Scott Ayers
10-29-2010, 03:57 PM
As Curly from The Three Stooges would say: "Certainly..Nyuk, Nyuck":)
var texture = GeGetStartupPath();
texture->FileSelect("Select bitmap", FALSE);// Launch the file Browser
var bitmap = new(BaseBitmap,1,1);
bitmap->Load(texture);// Load the texture
var texture_x;
var texture_y;
texture_x = bitmap->GetWidth();
texture_y = bitmap->GetHeight();

CallCommand(5168); // Create a plane
object()#PRIM_AXIS = 5;
object()#PRIM_PLANE_WIDTH = texture_x;
object()#PRIM_PLANE_HEIGHT = texture_y;


-ScottA

Jor-Art
11-09-2010, 08:39 AM
Thank you Scott, for the fast response, and sorry for the late reply...
This was helpful to get me on the right track.

Jörg

CGTalk Moderation
11-09-2010, 08:39 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.