三九宝宝网宝宝绘画儿童画

vb图片半透明

03月17日 编辑 39baobao.com

[WPS怎么在文字上覆盖透明图片]WPS在文字上覆盖透明图片的操作方法如下: 1、首先就是打开WPS文档,选中你需要操作的图片,鼠标右击选择“其他布局选项”。 2、接着打开“布局”的对话框后,在左上方的选项点击...+阅读

添加两个 picture名字分别为 picture1 和picture2之后在picture1里添加图片.最后添加这些代码.Const AC_SRC_OVER = &H0Private Type BLENDFUNCTION BlendOp As Byte BlendFlags As Byte SourceConstantAlpha As Byte AlphaFormat As ByteEnd TypePrivate Declare Function AlphaBlend Lib "msimg32.dll" (ByVal hdc As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal hdc As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal BLENDFUNCT As Long) As LongPrivate Declare Sub RtlMoveMemory Lib "kernel32.dll" (Destination As Any, Source As Any, ByVal Length As Long)Private Sub Form_Load()Dim BF As BLENDFUNCTION, lBF As LongPicture1.AutoRedraw = TruePicture2.AutoRedraw = TruePicture1.ScaleMode = vbPixelsPicture2.ScaleMode = vbPixelsWith BF .BlendOp = AC_SRC_OVER .BlendFlags = 0 .SourceConstantAlpha = 128 .AlphaFormat = 0End With 'copy the BLENDFUNCTION-structure to a LongRtlMoveMemory lBF, BF, 4 'AlphaBlend the picture from Picture1 over the picture of Picture2AlphaBlend Picture2.hdc, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, Picture1.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, lBFEnd Sub

VB如何使一张图片在控件里显示出半透明效果的问题

下面的代码可以解决你的问题直接复制就可以了如还有问题发信给我 090900009163.com'-----------------------------'使用说明:'1.新建一个标准exe工程'2.放置1个CommandButton 控件(使用默认名)'3.把下面的代码复制进去就可以了'-----------------------------Option Explicit'Transparancy API'sPrivate Declare Function SetLayeredWindowAttributes Lib "user32" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As LongPrivate Declare Function UpdateLayeredWindow Lib "user32" (ByVal hWnd As Long, ByVal hdcDst As Long, pptDst As Any, psize As Any, ByVal hdcSrc As Long, pptSrc As Any, crKey As Long, ByVal pblend As Long, ByVal dwFlags As Long) As LongPrivate Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As LongPrivate Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As LongPrivate Const GWL_EXSTYLE = (-20)Private Const LWA_COLORKEY = &H1Private Const LWA_ALPHA = &H2Private Const ULW_COLORKEY = &H1Private Const ULW_ALPHA = &H2Private Const ULW_OPAQUE = &H4Private Const WS_EX_LAYERED = &H80000Public Function isTransparent(ByVal hWnd As Long) As BooleanOn Error Resume NextDim Msg As LongMsg = GetWindowLong(hWnd, GWL_EXSTYLE)If (Msg And WS_EX_LAYERED) = WS_EX_LAYERED ThenisTransparent = TrueElseisTransparent = FalseEnd IfIf Err ThenisTransparent = FalseEnd IfEnd FunctionPublic Function MakeTransparent(ByVal hWnd As Long, ByVal Perc As Integer) As LongDim Msg As LongOn Error Resume NextPerc = 100If Perc255 ThenMakeTransparent = 1ElseMsg = GetWindowLong(hWnd, GWL_EXSTYLE)Msg = Msg Or WS_EX_LAYEREDSetWindowLong hWnd, GWL_EXSTYLE, MsgSetLayeredWindowAttributes hWnd, 0, Perc, LWA_ALPHAMakeTransparent = 0End IfIf Err ThenMakeTransparent = 2End IfEnd FunctionPublic Function MakeOpaque(ByVal hWnd As Long) As LongDim Msg As LongOn Error Resume NextMsg = GetWindowLong(hWnd, GWL_EXSTYLE)Msg = Msg And Not WS_EX_LAYEREDSetWindowLong hWnd, GWL_EXSTYLE, MsgSetLayeredWindowAttributes hWnd, 0, 0, LWA_ALPHAMakeOpaque = 0If Err ThenMakeOpaque = 2End IfEnd Function'透明Private Sub Command1_Click() MakeTransparent Me.hWnd, 20End Sub

以下为关联文档:

vb鼠标放在图片上换图片新建一个资源文件,添加两个位图资源,资源号分别为101,102. Private Sub Form_Load() Picture1.Picture = LoadResPicture(102, 0) End Sub Private Sub Form_MouseMove(Button...

png透明图片网上说图片格式PNG可以无背景图片透明化无压损是PNG格式是由Netscape公司开发出来的格式,可以用于网络图像,但它不同于GIF格式图像只能保存256色,PNG格式可以保存24位的真彩色图像,并且支持透明背景和消除锯齿边缘的功能,可以在...

PowerPoint2003如何设置图片透明首先启动PowerPoint2003,插入图片,单击菜单栏--插入--图片--来自文件。 插入图片 弹出本地对话框,选取图片,右击,显示图片工具栏。 显示图片工具栏 从上方的图片工具栏上点击右...

ppt图片怎么设置透明1、图片透明度在PPT里不能直接改变,只有形状的透明度可以被改变,所以要想改变图片透明度,只能曲线救国; 2、具体的方法如下: 1)插入图片,然后按照图片的大小绘制一个一样大的矩形...

ppt怎样将图片背景设置为透明1、首先在电脑上打开PPT软件,然后在PPT中新建一个空白文档,然后在上方工具栏中选择“插入”-“图片”。 2、接下来用鼠标左键双击刚刚插入的图片,然后在顶部就会出现格式栏,点...

VB6 0如何设置frame框架透明显示窗体背景图片颜色不能直接设置透明,有控件好像可以。控件的大小,可以先获取窗体的大小,然后按窗体放大缩小的后的比例进行调整。给你弄个调整大小的例子 弄一个窗体,然后添加e799bee5baa6e79fa5e...

PPT 2013如何设置图片为半透明1、打开PPT2013,新建一个空白页,然后点击工具栏上的”插入“。 2、在弹出插入的窗口中点击”图片“。 3、找到自己要插入到PPT里面的图片并选择它,然后点击插入(s)。 4、点击...

怎么把图片弄成透明怎么把图片弄成透明的,怎么把图片变什么透明的样式:加“自定义”模块在空间的自定义里,有四种类型的模块是我们可以自己添加的,都很简单。点开“自定义”有“新建模块”,有四种可...

用 photoshop如何制做透明图片用 photoshop如何制做透明图片:如何用Photoshop来制作透明图片呢? 答:Photoshop 5.0提供了对WEB格式的支持,它可输出GIF89a格式,以制作透明背景图。将这样的图形加入网页中,会带来...

推荐阅读
图文推荐