Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Image in Background (Sketchpad)

Hi all,

I'm trying to create an experiment with a mouse response on ROI. My ROI are rect which change position on the sketchpad. Now I want to include an image in the background and make my ROI transparent, so it looks like the participants are clicking on the background image but are actually clicking on my ROI. Anyhow when I put the image in the background I am not able to click on my ROI and get a correct response, even when I put the image in the background (z_index=1) it still does not except clicks on the ROI.

How can I put an image in the background that is not clickable but just there (for every trial)?

Thanks in advance!


  • Hi Igotta,

    I am not sure what ROI means, but maybe it is not that important.

    If you creat a canvas in an inline_script you may set an image at the background.

    Then you can put additional things (text, rectangles) onto the image. I am not sure whether you can set it transparant, but if your background image is white at these parts you can add a white rectangle.

    Then you can define that only the rectangle is clickable.

    Hope this helps


  • Hi Stephan,

    thank you for your quick response. I'm trying to draw the picture on my canvas using an inline script before my sketchpad


    my_canvas = Canvas ()

    path = exp.pool[u'Dringend.png']


    run: ()

    but the picture only appears for one millisecond.

    Also is it possible to combine a sketchpad and an inline script in a way that the inline script only adds the image to the existing sketchpad or do I need to build everything in the script?

    Thanks for your help


  • Ok.Now I managed to combine sketchpad and image. What I can't manage is to put the image in the background. I tried z_index=1 but it's not working. Here is my script so far:

    prepare (after sketchpad):

    my_canvas = items['new_sketchpad'].canvas


    bgroung_image = exp.get_file('Dringend.png')

    my_canvas.image(bgroung_image, True, -100, -300 )

    Can anyone help to put the bground_image in the background?

    Thanks and cheers!

  • I haven't followed the complete discussion, but if you have a sketchpad that is being executed (run_if statement is set to always, or evaluates to True), and there is no delay between the inline_script and the sketchpad, the sketchpad will override the canvas within 1-2 frame flips. This is because right after you show your canvas in the prepare phase, the sketchpad is being executed in the run phase. Do you see?

    To check whether this is really what happens, you can add a delay after So for example, clock.sleep(3000) timeouts for 3 seconds.

    If you want to get the image onto your sketchpad, you have then reverse the assignment: items['new_sketchpad'].canvas = my_canvas. But honestly, I don't really get why you would do that. Why don't just use inline_scripts or just use sketchpads? Why combining them?


    Buy Me A Coffee

  • Hi Eduard,

    I'm combining inline_script and sketchpad simply because i could't figure out how to do this only in sketchpad. If there is a way to do that that would be great.

    In the beginning of this discussion I described my issue a little more detailed. Do you have an idea how to put an image in the background of my sketchpad so when the ROI on top of it are clicked the mouse still collects a response? z_index does not work unfortunately.


  • Never mind,

    solved it :) Thanks for the help anyway!

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games