Author Topic: Questions regarding undocumented GuiBitmapCtrl functionality  (Read 647 times)

How does the value of overflowImage of a GuiBitmapCtrl change how the image is rendered.
Common sense would lead me to believe that if I were to leave wrap off, and the size of the image is greater than the extent of my GuiBitmapCtrl, the image would extend past the bounds of the gui element, however this is not the case.
I can't find any relevant documentation, and so far I see no difference when experimenting.

Also, GuiBitmapCtrl::setActive() appears to have no effect...  but then why would it exist?

I also want to be able to maintain an image's original size (1 pixel in the image file is 1 pixel rendered on screen, no antialiasing) and so far it appears the only way to really ensure that is to use GuiBitmapCtrl.wrap=1, but I really want to avoid wrapping the image.

Also, GuiBitmapCtrl.setValue() allows you to specify an offset (from the bottom left corner?) of the image to place at the bottom left corner of the GuiBitmapCtrl, however I want to be able to do the inverse (have the image start with the bottom left pixel of the image at an offset from the bottom left pixel of the guibitmapctrl). As you can see in the screenshots provided, simply specifying a negative offset doesn't solve this problem. (NOTE: the reason i want to avoid wrapping the image as stated above is because I want to be able to have an offset such that part of the guibitmapctrl is transparent, instead of viewing the other edge of the image.) The only way I can really think of doing this is setting the extent of the guibitmapctrl equal to the size of the bitmap, and then putting the guibitmapctrl inside another gui element (i tested it with a GuiControll) and that seems to work, although this leaves the problem of determining the proper extents and positions. (The position needs to be based off of the extent, which needs to be based off of the dimensions of the bitmap (as not to scale it) and I don't have a reliable way of getting that.)

Finally, GuiBitmapCtrl::getPixelColor() return values that do not reflect the actual color being displayed, is this a bug?

I think the GG forums may be the place to go for these questions, however overflowImage appears to be specific to blockland, so I'm starting here.
« Last Edit: May 19, 2010, 05:31:36 PM by BobAndRob »

How does the value of overflowImage of a GuiBitmapCtrl change how the image is rendered.
Common sense would lead me to believe that if I were to leave wrap off, and the size of the image is greater than the extent of my GuiBitmapCtrl, the image would extend past the bounds of the gui element, however this is not the case.
I dont know how the overflow stuff works - but for ANY gui control -- not just bitmaps, if you put it inside another control thats bigger, it will get chopped off.  this is universal to the torqe gui rendering system.  So your large bitmaps will get chopped off

I can't find any relevant documentation, and so far I see no difference when experimenting.

Also, GuiBitmapCtrl::setActive() appears to have no effect...  but then why would it exist?
Welcome to torqueScript :D  The land of nonexistant documentation and redundant methods.

I also want to be able to maintain an image's original size (1 pixel in the image file is 1 pixel rendered on screen, no antialiasing) and so far it appears the only way to really ensure that is to use GuiBitmapCtrl.wrap=1, but I really want to avoid wrapping the image.
The only ive found to get that to work is to make sure your bitmap control extent is exactly the same size as your bitmap image which you have already figured out.

Also, GuiBitmapCtrl.setValue() allows you to specify an offset (from the bottom left corner?) of the image to place at the bottom left corner of the GuiBitmapCtrl, however I want to be able to do the inverse (have the image start with the bottom left pixel of the image at an offset from the bottom left pixel of the guibitmapctrl). As you can see in the screenshots provided, simply specifying a negative offset doesn't solve this problem. (NOTE: the reason i want to avoid wrapping the image as stated above is because I want to be able to have an offset such that part of the guibitmapctrl is transparent, instead of viewing the other edge of the image.) The only way I can really think of doing this is setting the extent of the guibitmapctrl equal to the size of the bitmap, and then putting the guibitmapctrl inside another gui element (i tested it with a GuiControll) and that seems to work, although this leaves the problem of determining the proper extents and positions. (The position needs to be based off of the extent, which needs to be based off of the dimensions of the bitmap (as not to scale it) and I don't have a reliable way of getting that.)
Your on the right track.  I dont have a solution off the top of my head,  but if you put the bitmap inside another gui control and then adjust the position of your bitmap control that should get you going a bit further.

Also if you can explain what your trying to accomplish in the end, mabye there is a different way to do the same thing.