Results 1 to 20 of 20

Thread: Help!!!!! Anyone!

Hybrid View

  1. #1

    Thread Starter
    Lively Member haruki's Avatar
    Join Date
    Mar 2005
    Location
    Shibuya / Japan
    Posts
    118

    Re: Help!!!!! Anyone!

    Yes that's it. But I already managed to figure that out when using the property wizard.

    However, It didnt work as I planed. I need to do bltbit on the form or a picturebox. but want their background to be transparent. I used the form and put it to transparent (borderstyle=0) and added hDc, but the image didnt get printed on the form. it probably got printed, but the form is transparent. wacked!

    there must be som way. because i want to move the image as It is transparent as well.

    With GDI it is possible I think, but I have no idea how to do it. Have anyone here coded with GDI?

  2. #2
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575

    Re: Help!!!!! Anyone!

    Have you tried TransparentBlt to copy the image??
    My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]

  3. #3
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Help!!!!! Anyone!

    Isn't TransparentBlt an function found on the internet? I don't think it's an actual API, in which case, Planet Source Code or Google can help.

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  4. #4
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575

    Re: Help!!!!! Anyone!

    No No - its a real function

    Declare Function TransparentBlt Lib "msimg32.dll" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal crTransparent As Long) As Boolean
    My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]

  5. #5
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Help!!!!! Anyone!

    Oh my god. I searched for ages long ago and had to come up with my own! Then I got told there was one on the internet...

    /me slaps myself..

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  6. #6

    Thread Starter
    Lively Member haruki's Avatar
    Join Date
    Mar 2005
    Location
    Shibuya / Japan
    Posts
    118

    Re: Help!!!!! Anyone!

    Okey, I have no idea what you mean. Anyway....

    I want to use the forma png as it is anti-aliased. I have printed a transparent anti-aliased PNG file on a PictureBox. However as the PictureBox isnt transparent the image will not be transparent on the form.
    I could print it on the form directly, but then I cant use the properties on the PictureBox so I can move it with the mouse.

    I have included the file here. Have a look and see what im trying to do. Press the color buttons and look what I mean with with the picturebox layer is blocking the image.

    Anyone know how to use the GDI and print PNG files, that would be better. I've seen a quite messy applikation doing so.
    Attached Files Attached Files

  7. #7
    Fanatic Member THEROB's Avatar
    Join Date
    Oct 2000
    Location
    I'm cold and there are wolves after me
    Posts
    575

    Re: Help!!!!! Anyone!

    I can't use the project because I don't have a license for the SetPNGImage

    Try this set the png picture to a picture box using the setpngimage function then copy the picture from the picturebox to the form using the transparentblt function [defined above]: - use it like this:

    BOOL TransparentBlt(
    HDC hdcDest, // handle to destination DC
    int nXOriginDest, // x-coord of destination upper-left corner
    int nYOriginDest, // y-coord of destination upper-left corner
    int nWidthDest, // width of destination rectangle
    int hHeightDest, // height of destination rectangle
    HDC hdcSrc, // handle to source DC
    int nXOriginSrc, // x-coord of source upper-left corner
    int nYOriginSrc, // y-coord of source upper-left corner
    int nWidthSrc, // width of source rectangle
    int nHeightSrc, // height of source rectangle
    UINT crTransparent // color to make transparent
    );
    My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]

  8. #8
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246

    Re: Help!!!!! Anyone!

    Quote Originally Posted by haruki
    Okey, I have no idea what you mean. Anyway....

    I want to use the forma png as it is anti-aliased. I have printed a transparent anti-aliased PNG file on a PictureBox. However as the PictureBox isnt transparent the image will not be transparent on the form.
    I could print it on the form directly, but then I cant use the properties on the PictureBox so I can move it with the mouse.

    I have included the file here. Have a look and see what im trying to do. Press the color buttons and look what I mean with with the picturebox layer is blocking the image.

    Anyone know how to use the GDI and print PNG files, that would be better. I've seen a quite messy applikation doing so.
    You could move it around with the mouse using the form. The form has the same basic drawing properties of the PictureBox, aswell as the same Functions (MouseDown/Up, etc..)

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

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