Madjack Posted March 26, 2012 Share Posted March 26, 2012 Ok - time for another dumb newbie question. I'm looking to load an image and read pixel colours (with which to ultimately deform a mesh) I would have thought loadimage would be the one, but I'm finding defining a TImage is giving a 'Identifier TImage not found' error when used with the framework. Strict Framework leadwerks.engine Local j_image:TImage I'm using BMax v1.45, LE is up to date. Remove the framework ref and the code compiles ok. Is anyone else experiencing this? What am I missing? Quote Link to comment Share on other sites More sharing options...
Naughty Alien Posted March 26, 2012 Share Posted March 26, 2012 LE doesnt know TImage..instead, LE loading TTexture Quote Link to comment Share on other sites More sharing options...
Madjack Posted March 26, 2012 Author Share Posted March 26, 2012 NA Err - how do I read a pixel color from a texture? I can't see a corresponding readpixel or getcolor command. Quote Link to comment Share on other sites More sharing options...
DaDonik Posted March 26, 2012 Share Posted March 26, 2012 You might be able to use OpenGL functions on that TTexture. Haven't tried this myself, so it's just an idea. There is also the possibility to use an external library to load images and read their pixels. I have used http://www.lonesock.net/soil.html in the past and it worked pretty well. Quote (Win7 64bit) && (i7 3770K @ 3,5ghz) && (16gb DDR3 @ 1600mhz) && (Geforce660TI) Link to comment Share on other sites More sharing options...
Madjack Posted March 26, 2012 Author Share Posted March 26, 2012 LE doesn't allow native access to pixel data? Seriously? <EDIT> This makes no sense to me. So I can create a buffer for a texture and store texture channel data in that buffer but there's no easy way to read a colour at a given x/y? For example ; Local TEX_TEMP:TTexture = LoadTexture("abstract::CHECKERBOARD.JPG") Local T_BUFFER:TBuffer = CreateBuffer(256, 256) SetBuffer(T_BUFFER) SetColorBuffer(T_BUFFER, TEX_TEMP) GetColorBufferXY(T_BUFFER) ' Something like this does not exist in LE?? Quote Link to comment Share on other sites More sharing options...
Madjack Posted March 26, 2012 Author Share Posted March 26, 2012 Hi all Any further info anyone can provide regards the above? Usually when people stop responding it's because of a fundamental misunderstanding on the part of the OP. Is that the case here? Am I out of line? Quote Link to comment Share on other sites More sharing options...
macklebee Posted March 26, 2012 Share Posted March 26, 2012 well it hasnt even been a day since you first posted... patience... remember that the community is spread out across many different time zones and most of us have jobs... so if you do not get an immediate response, give it time... as for your issue, you could just import the glmax2d module into your bmax code, then just use the needed commands from it... im sure there are some commands that you would have to use namespace to prevent conflicts between LE and max2d... just a thought... or you could use raw opengl commands... <edit> the import seems to work... but i have no idea if this will cause any issues elsewhere... using raw opengl might be better... madjack_opengl.bmx Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
Madjack Posted March 27, 2012 Author Share Posted March 27, 2012 mb Thanks for the info - sorry, I was a little impatient. Currently converting my large Xors codebase to LE and I'm finding the process quite distressing But I'll get on top of it! Quote Link to comment Share on other sites More sharing options...
Madjack Posted March 28, 2012 Author Share Posted March 28, 2012 mb Duh! Looks like I could just use LoadPixmap / ReadPixel to get the colour values - doesn't need to be a texture. Would using a pixmap likely cause any issues with LE do you think? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.