Help me if you can.

Discussion in 'HTML & Website Design' started by sumonht1990, Mar 18, 2012.

  1. #1
    I am a 3d technical artist. But I have a little knowledge about HTML.
    I have
    - A PNG image without alpha to be used as the background.
    - One or more PNG's with alpha to be composited on top of this background using the embedded alpha channels.

    I want to do this using the Canvas element and what I learned from searching the web is they often composite everything offscreen and then draw it to the Canvas.
    So if anyone could provide me with small example I would be eternally grateful. It's mainly the syntax that stumps me right now, please.
     
    sumonht1990, Mar 18, 2012 IP
  2. Deluxious

    Deluxious Greenhorn

    Messages:
    32
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    18
    #2
    It sounds like what you're trying to do wouldn't require use of the canvas. You should simply be able to overlay your 24-bit pngs on top of the background and it should look just fine in all relatively modern browsers.

    
    <div style='background-image: url("the8bitbackground.png")'>
    <img src="24bitwtransparencygradients.png" />
    </div>
    
    Code (markup):
    In that example, you'd see the background images/colors show through. Hope that helps.

    Canvas can be used to generate images dynamically using javascript.
     
    Deluxious, Mar 19, 2012 IP
  3. sumonht1990

    sumonht1990 Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you. I am trying...
     
    sumonht1990, Mar 20, 2012 IP
  4. Jocaziggg

    Jocaziggg Greenhorn

    Messages:
    33
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    I dont think that you can do that vith div tag... you have to atach those transparent elements on that main png image, and use one background image.Then you put div tags to match that transparent elements.
     
    Jocaziggg, Mar 20, 2012 IP
  5. Ashaya

    Ashaya Active Member

    Messages:
    124
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    83
    #5
    not sure but still Deluxious seems to be quite correct!
     
    Ashaya, Mar 21, 2012 IP