|
-
August 9th, 2001, 05:00 PM
#1
Image Opacity
Hi,
i want to know if it is possible in VB to change the opacity of an image.
Thanks in advance.
"the opposition of the opposites is the engine of becoming"
-
August 9th, 2001, 07:55 PM
#2
Re: Image Opacity
Yes, using the AlphaBlend() function from msimg32.dll
Here's the declaration:
Private Declare Function AlphaBlend Lib "msimg32.dll" (ByVal hdcDest As Long, ByVal nXOriginDest As Long, ByVal nYOriginDest As Long, ByVal nWidthDest As Long, ByVal nHeightDest As Long, ByVal hdcSrc As Long, ByVal nXOriginSrc As Long, ByVal nYOriginSrc As Long, ByVal nWidthSrc As Long, ByVal nHeightSrc As Long, ByVal BF As Long) As Long
The third byte of the BF parameter is the transparency. Here's a sample call:
Dim lngBlend as Long
Dim Trans as Integer
Trans = 120 'Can be from 0 to 255
lngBlend = Val("&h" & Hex(Trans) & "00" & "00")
AlphaBlend destHDC, XDest, YDest, destWidth, destHeight, srcHDC, XSrc, ycrc, srcWidth, srcHeight, lngBlend
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|