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?
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]
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]
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.
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]
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..)