Results 1 to 10 of 10

Thread: [RESOLVED] Help: Replace Pink with Transparent! BitBlt? TransBlt?

  1. #1

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Resolved [RESOLVED] Help: Replace Pink with Transparent! BitBlt? TransBlt?

    Ive been searching.. and searching .. and searching all over the place for a decent easy removal of a pink colour BG, but no success.

    I basically have an image with pink around it.. I need to remove the pink and just draw the image.

    Basically its a custom OptionButtim im creating. Since its circular, i need to get rid of the pink corners.

    Any ideas on this?
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  2. #2
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Help: Replace Pink with Transparent! BitBlt? TransBlt?

    some1uk03,
    check wheather the attached project has somthing for you
    Attached Files Attached Files

  3. #3
    Hyperactive Member
    Join Date
    Aug 2006
    Posts
    367

    Re: Help: Replace Pink with Transparent! BitBlt? TransBlt?

    Here is a well explained example of using bitblt to do that.. If you would be better of with full alphashadowing I'd suggest searching for calphadibsection.cls on google.. Its far more powerful, and not much slower actually..
    Attached Files Attached Files

  4. #4

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Re: Help: Replace Pink with Transparent! BitBlt? TransBlt?

    Fazi... Great example there with alpha blending/shadows, but not what i was looking for.

    triggernum5 however has posted exactly what i was looking for.

    BUT with a small problem!!

    The program works as is, but when i implemented it to my project, the result is messy. I get all dark black dots.. like some noise.

    I just cant figure it out. It works as a separate project but not within mine.
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  5. #5
    Hyperactive Member
    Join Date
    Aug 2006
    Posts
    367

    Re: Help: Replace Pink with Transparent! BitBlt? TransBlt?

    How big are the images you are using it with, and have you stepped through the sub to see what line results begin to go downhill..

  6. #6

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Re: Help: Replace Pink with Transparent! BitBlt? TransBlt?

    well the image is 13x65. Its a fairly small image.

    when i add a msgbox instead of the Call arg. all numbers are returned >=1.

    So no 0.

    I dont know wat else it could be.

    since its working in a clean project, but on mine.
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  7. #7
    Hyperactive Member
    Join Date
    Aug 2006
    Posts
    367

    Re: Help: Replace Pink with Transparent! BitBlt? TransBlt?

    I don't know either unless you post your project.. I meant step through to see what step the results are unexpected at, not necessarily in error..

  8. #8

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Re: Help: Replace Pink with Transparent! BitBlt? TransBlt?

    I think I kind of got it, but with a different method.

    Using the GetPixel & SetPixelV APIs.

    Basically scans each pixel on the picturebox and replaces a certain colour with a different one..

    It does the job I need, but takes quite time..

    Any Other ideas to speed this up...?
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  9. #9
    Addicted Member Vanasha's Avatar
    Join Date
    Jun 2007
    Location
    In a bin.>_>
    Posts
    152

    Re: Help: Replace Pink with Transparent! BitBlt? TransBlt?

    I've heard that GetDIBits is a lot faster GetPixel, it seems as if you put the pixels into a byte array. Try searching.
    Quote Originally Posted by Vanasha
    Sorry, i'm slow.


  10. #10

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Re: Help: Replace Pink with Transparent! BitBlt? TransBlt?

    Finally a solution after all... : )

    http://www.vbforums.com/showthread.php?t=424210
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



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