Results 1 to 10 of 10

Thread: What's the best method for transparent images.

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    The Dark Side of the Moon
    Posts
    448

    What's the best method for transparent images.

    I have photoshop, but I can't get anything on a VB form that's transparent. (Despite all the settings.) I looked into bit blitting, but it sucks in regards to having to individually make the image masks for it. If it were mostly done from code I would like it, and I'm not sure if it supports gifs.

    So what is the best way to get transparent images?

  2. #2
    New Member
    Join Date
    Aug 2001
    Location
    CO
    Posts
    4
    bitblt is by far better then using seperate created images.. with bitblt u can make all the images into 1 image file... load it to a picturebox(or created DC) and bitblt the picture u want. if you use
    images and put them in to picture boxes and move them around.. youll get flickering..

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2001
    Location
    The Dark Side of the Moon
    Posts
    448
    What do you recommend me doing for Direct X? Know any good tutorials?

  4. #4
    Frenzied Member Jotaf98's Avatar
    Join Date
    Jun 2000
    Location
    I'm not gonna give you my IP address! Ok... Portugal, South-Western Europe, 3rd rock from the sun (our star is easy to find, a 47 Ursae Majoris in the Milky Way :p )
    Posts
    1,457
    Well, first, I'd recommend some experience with bitblt. Then, grab one of the hundreds of "easy-to-use" modules for DirectX, so if you, for example, wanna initialize DX, you don't have to type 100 lines of code

    You might have to download several of them and then pick the one that you think is better. In my case, I learned DX by correcting the bugs in one of such modules
    Code:
    Temp = Me.GetIQ()
    'Error 9: Overflow
    'DON'T PANIC! :eek:

    To learn how to use realistic effects in your games like fire, rain, snow and magic effects, read my article on particles systems here.


    Jotaf's Theories!
    "Cats land on their feet. Toast lands peanut butter side down. A cat with toast strapped to its back will hover above the ground in a state of quantum indecision."

  5. #5
    Lively Member
    Join Date
    Jul 2000
    Location
    New Delhi, India
    Posts
    75
    I think what you need is opacity and not transparency. Opactiy is the level of transparency. technically speaking you can achieve opacity in visual basic through alpha blending. search for alpha blending in planetsourcecode.com. good luck !!!

  6. #6
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    (ignore this post if you are in fact making a game, not a normal application)


    Originally posted by JSG
    directx (my personal prefrence) if you don't mind puting a bit more time into it....and once you have done it once or twice it becomes second nature

    "what? it won't run? well duh, you'll need DirectX offcourse, even Solitaire required DirectX"

    imagine that

    (ok, a bit overexagorated maybe , but read on and you'll understand)


    What do you need the transparancy for? Mostly, you can simply fake it by putting the background in the image itself. You could also create a mask at runtime, then use BitBlt, this will eliminate the overhead of DirectX.

    Basically, don't jump directly to DirectX, first determine what the goal is, how it can be done best. Startup time vs. runtime speeds, it's a choice you have to make. DirectX requires a lot more time and memory resources, however, it runs quite fast after that. BitBlt is easier, doesn't need initialization, but won't do any good for high-speed animations.
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

  7. #7
    Frenzied Member macai's Avatar
    Join Date
    Jul 2001
    Location
    Napanoch NY
    Posts
    1,228
    Originally posted by tppradeep18
    I think what you need is opacity and not transparency. Opactiy is the level of transparency. technically speaking you can achieve opacity in visual basic through alpha blending. search for alpha blending in planetsourcecode.com. good luck !!!
    Alpha Blending is only doing opacity in relation to something else. To prove this, try doing this on a form with a picturebox overlapping the contorls and try to alphablend that.
    Luke

  8. #8
    Fanatic Member PsychoMark's Avatar
    Join Date
    Feb 2001
    Location
    Netherlands
    Posts
    540
    I think you should've looked at the last post date before posting that reply
    Teaudirenopossum.Musasapientumfixaestinaure.
    (I can't hear you. There's a banana in my ear)

  9. #9
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Ack, GRAVEDIGGERS
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  10. #10
    Addicted Member
    Join Date
    Aug 2002
    Posts
    192
    Jared, I reccommend a user-defined type I made called AnimSurf2D. It is already a solid performer speed-wise because of direct access to graphics arrays. I made a few custom blit subs that are not that difficult to understand. they do their own clipping (otherwise, because it's direct array access you can get array bounds error), masking and alpha-blending and simple colorize effects. The subs work with the type, and you can also bitblt the type because one member of the type holds the 'memory dc' of device-independent bitmaps (bitmaps stored in memory) created with windows api. so with the type you get all these pieces of information: width, height, totalpixels, direct access to the actual bitmap array by 2 different ways .. as Long (for speed) or as byte for quality image processing. plus i have a 'high resolution' array (heavy on memory but provides lossless spectrum shift operations if you know how to do that sort of thing) (i wrote a sub that for that) and a createsurfacefromfile sub that writes 255 into the alpha channel of the surface for every pixel that is not black, for simple mask operation of one of my custom blit subs.

    The biggest advantage though is how easy it all is to use. Let me know and I will post an example

Posting Permissions

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



Click Here to Expand Forum to Full Width