Results 1 to 9 of 9

Thread: picture transpaence in canvas mode?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    picture transpaence in canvas mode?

    How I can make a picture (*.bmp, *jpg) transparent in canvas mode? It's possible with current thinbasic version to store two pictures over one place (with magenta trick?) ? bye, largo

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,782
    Rep Power
    10
    Hi Largo,

    no I'm sorry but at the moment there is no a native command able to do that job.
    I will see what I can do in next thinBasic version.

    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    I think this is a job for GDIplus. Will you support a GDIp canvas in thinBasic 2.0, Eros?

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,782
    Rep Power
    10
    GdiPlus module sure. A pseudo basic version has always been there in thinbasic distribution.
    A GdiPlus Canvas native control ... maybe
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,129
    Rep Power
    732
    If you don't need ultrafast solution, you can have a look at:
    /SampleScripts/UI/Canvas/Image_Background/Image_Background.tBasic

    ...which shows approach with magenta masked images on canvas.

    If you need solid speed for thousands of transparent, I would recommend to jump over GDI Plus straight to the realm of GPUs and try alpha masking / alpha blending.
    In ThinBASIC, you can use pure OpenGL for this, or for better comfort TBGL. When you look at TBGL_LoadTexture command, you will see you can specify optional transparent color.

    Other approach would be using Mike's sprite functions, have a look at examples under:
    /SampleScripts/TBGL/Sprites/


    Petr
    Last edited by Petr Schreiber; 29-05-2012 at 08:16.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  6. #6
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,782
    Rep Power
    10
    Hi Petr,

    thanks and sorry: I forgot about the "Quick and dirty approach" example you developed

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Similar Threads

  1. Get Pixel Color from a Picture
    By zak in forum UI (User Interface)
    Replies: 3
    Last Post: 09-03-2011, 17:07
  2. add picture as attachements?
    By Lionheart008 in forum thinBasic General
    Replies: 0
    Last Post: 07-10-2010, 18:57
  3. texturing model by one picture stretched
    By zak in forum TBGL General
    Replies: 3
    Last Post: 11-09-2010, 20:29
  4. Replies: 6
    Last Post: 16-06-2010, 06:40

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •