Results 1 to 9 of 9

Thread: Picture Box doesn't work properly with GIF Files

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2005
    Posts
    168

    Picture Box doesn't work properly with GIF Files

    I have a picture box and when I set a gif file with transparent background it shows some shaded area around it and when I set that image to Image control then that area is transparent. Is there any way I can do this in picture box. Also I want to know how to flip and rotate image in it.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Picture Box doesn't work properly with GIF Files

    Welcome to the Forums.

    What are your picturebox appearance settings? Like backcolor, appearance, and borderstyle?
    If your gif has a transparent background you should be able to see the transparency
    when you change between backcolors.

    A picturebox shows transparencies automatically.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2005
    Posts
    168

    Re: Picture Box doesn't work properly with GIF Files

    I'm setting the back color of the parent and no borders. It works fine when the container in which picture box is kept has a color set at the background but when the container (say form) has a picture then it shows the same shaded area around the image. Please help me as I'm new to this.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Picture Box doesn't work properly with GIF Files

    It may be that the picturebox is not a transparent control like the image control. So it
    will be showing the gif with a transparent background, which shows the picture box
    background through, but the picture box is not transparent itself so the forms background
    will not be visible through it. This it just the way the picture box control works.


    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Feb 2005
    Posts
    168

    Re: Picture Box doesn't work properly with GIF Files

    Is there any way to make picture box transparent using a usercontorl?

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Picture Box doesn't work properly with GIF Files

    I'm not sure. What about using the Image control? It has no problems with transparencies.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Feb 2005
    Posts
    168

    Re: Picture Box doesn't work properly with GIF Files

    I've made a usercontrol with picturebox and Image box. It's transparent now I want to know how to flip and rotate images in it.

  8. #8
    New Member
    Join Date
    Mar 2005
    Posts
    1

    Re: Picture Box doesn't work properly with GIF Files

    Hello, I am a year 12 software design student currently working on a project and I am looking for a way to make the picture box background transparent and was wondering if I could use the control that you created that does that. I need to be able to use the picture box control to draw lines and shapes and have the scale functions of a regular picture box. Thankyou.

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Feb 2005
    Posts
    168

    Re: Picture Box doesn't work properly with GIF Files

    Sure if this is of any help to you that will be worth it for me. I'll attach it tomorrow for you as I'm not near my machine today.

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