GDI+ and transparency

This is a discussion on GDI+ and transparency within the Windows Programming forums, part of the Platform Specific Boards category; I want to draw some shapes on the screen, but I don't want any Window to be seen. I can't ...

  1. #1
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231

    Question GDI+ and transparency

    I want to draw some shapes on the screen, but I don't want any Window to be seen. I can't draw anything without a Window now. I can draw only in a window, its like a prison!
    I can write both managed and unmanaged. How can I do that?
    Last edited by siavoshkc; 07-30-2006 at 02:59 PM.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  2. #2

  3. #3
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231
    In managed code, when I create a region using

    Drawing::Region ^rg= gcnew Drawing::Region();

    I cannot atach a graphics object to it to paint it.

    It seems that this region is different.
    Last edited by siavoshkc; 07-31-2006 at 12:30 AM.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  4. #4
    Registered User
    Join Date
    May 2006
    Posts
    903
    That's not the point of regions. Regions are parts where painting is allowed for an application. Anything outside of the region in that window will not be rendered. You have to create regions for those things you want to draw and only these things will draw.

  5. #5
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,856
    >>but I don't want any Window to be seen.

    You must have a window for a windows application, even if that window is 1x1 and is hidden.

    Even games have windows, they are just full screen.

    I use a window style that doees not have a menu, system menu, title bar or border (ect).

    Something like WS_POPUP and the extended style WS_EX_CLIENTEDGE

    A region still needs to be seleceted into a DC to be drawn. The region just allows only certain areas of the client area to be drawn. Usually the rest is transparent.
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

  6. #6
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Use a region to make the window frame non-rectangular and then use a custom drawn window background to get the desired GUI effect you want. You can have transparent windows and there are examples of them on www.codeguru.com. There are examples of seemingly invisible dialogs with buttons hanging out in open space. MSDN also has examples of this technique.

    I frankly do not see the point for it as they are extremely hard to distinguish from all the background 'clutter' that normally is on a Windows desktop.
    Last edited by VirtualAce; 08-01-2006 at 06:01 AM.

  7. #7
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231
    I frankly do not see the point for it as they are extremely hard to distinguish from all the background 'clutter' that normally is on a Windows desktop.
    In my case my program has a start up show.
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  8. #8
    Registered User
    Join Date
    May 2006
    Posts
    903
    Did you not ever see programs with funky shape ? Well you've got your answer.

  9. #9
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,231
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Transparency function not working
    By frenchfry164 in forum Windows Programming
    Replies: 3
    Last Post: 01-01-2003, 06:02 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21