PDA

View Full Version : image button control exists?



largo_winch
01-03-2013, 12:15
http://www.thinbasic.com/community/showthread.php?12014-mouse-over-problem-(UI)&p=88057#post88057

a) next simple question if there's a chance with current thinbasic beta issue how to set a "picture (image)" on a button control. is there's any way for it? I have to create an image list for it? any example or link or info here at the board?

b) according to an example from ui folder/canvas/ with LIVEIMAGE or Imagebackground (the timer example with the cat and green and red point on gui) I have another question how to set the background for an image to "transparent" ? the image background for that example is a simple string (sImagebackground) and is setting by a usual canvas control. But if I move a picture over another one there are pixel artefacts (streams). I think it belongs to the background that should have same color as my font example has shown with foreground/background rgb's. but an image by loading from a string has no foreground/background colour nor the canvas control ;) I suppose I have to change clear canvas color(rgb(a,b,c),rgb(a,b,c) for it. but how?

bye, largo

Petr Schreiber
01-03-2013, 12:32
Hi Largo,

there is such a control - it is called XPButton and there are examples for it in /thinBasic/SampleScripts/UI/XPButton/.

But it seems the example does not work with ThinBASIC 1.9.3.0, I have made a report (http://www.thinbasic.com/community/project.php?do=gotonote&issuenoteid=2354) so Eros can have a look at the issue.

I am sorry, please stay tuned!


Petr

P.S. Maybe you could use Toolbar in the meanwhile

largo_winch
01-03-2013, 12:36
thanks petr, can you have please a look at my second part of question "b)" ;)

Petr Schreiber
01-03-2013, 13:58
Hi Largo,

the drawing of masked images is handled by RenderImageToExistingCanvasWithMaskedColor ( :) ) function in the live_image.tBasic example.
It works on simple principle - it makes all pixels of specified color transparent.

Do you think you could attach script demonstrating the problems you observe? I am not sure I understand the explanation fully.


Thanks,
Petr