Results 1 to 6 of 6

Thread: Jpegs transparent...

  1. #1

    Thread Starter
    Hyperactive Member Petergotchi's Avatar
    Join Date
    Jan 2002
    Location
    Dendermonde - Belgium
    Posts
    267

    Jpegs transparent...

    Hi...

    What is the best way to animate a jpeg picture with transparency over a form background ?
    I hope this is clear... I'll give an example... Let's say you've got a picture of a sea set as a background on a form! And you want to put a picture of a fish on it! Then you can't just put that fish on the form in a picturebox because it will be squared right... I want just the fish on my form and not the full square... Is there an easy way for doing that? Because I'm just a newbie but I would like to know more about that sort of programming!
    Do you guys have codes for that? Which are also easy to understand? :-D

    Greetz Pieter

    Ps: Thanx in advance ;-)
    Kind Regards,

    Pieter

    PS: If you found someone's answer helpful, please be so kind to rate that person.
    Thanks.

  2. #2
    Addicted Member
    Join Date
    Aug 2002
    Location
    Baltimore, MD
    Posts
    230
    Use DirectX7's DirectDraw. Read the tutorials over at http://www.directx4vb.com/

  3. #3
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    The fish needs to be a BMP or GIF (lossless compression of some sort), and can't be lossy compressed (ex. JPEG). The reason is the colour information is lost and the pixels aren't exactly white (if you had them white before).
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  4. #4
    Addicted Member jmiller's Avatar
    Join Date
    Jul 2002
    Location
    University of Michigan
    Posts
    238
    here's an idea:
    if you want to use straight vb....
    Save the picture with a black background where you want it to be transparant. then make a mask. where the pic is black, make it white, where its color, make it black. then:

    blit the mask using PaintPicture. in the opCode param put vbSrcAnd. then, in the exact same spot, blit the the source pic using PaintPicture, but put vbSrcPaint in the opCode Param. This should make it transparant. tell me if it works.

  5. #5

    Thread Starter
    Hyperactive Member Petergotchi's Avatar
    Join Date
    Jan 2002
    Location
    Dendermonde - Belgium
    Posts
    267

    Question

    I would if I could...
    Do you have a code example??
    Kind Regards,

    Pieter

    PS: If you found someone's answer helpful, please be so kind to rate that person.
    Thanks.

  6. #6
    Addicted Member
    Join Date
    Apr 2002
    Location
    Israel
    Posts
    152
    example
    Attached Files Attached Files

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