如何在picturebox 或 image 或其他能实现要求的控件中加入图片?
要求:
1。最底下是一副图片A,在他的相对位置加入其它图片B,C,D
2。A可以随意放大缩小,B,C,D始终在A的各自相对位置处。
3。通过命令可以实现B,C,或D的闪烁

解决方案 »

  1.   

    Option Explicit'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
    'MappingInfo=a,a,-1,Picture
    Public Property Get APicture() As Picture
        Set APicture = a.Picture
    End PropertyPublic Property Set APicture(ByVal New_APicture As Picture)
        Set a.Picture = New_APicture
        PropertyChanged "APicture"
    End Property'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
    'MappingInfo=b,b,-1,Picture
    Public Property Get BPicture() As Picture
        Set BPicture = b.Picture
    End PropertyPublic Property Set BPicture(ByVal New_BPicture As Picture)
        Set b.Picture = New_BPicture
        PropertyChanged "BPicture"
    End Property'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
    'MappingInfo=d,d,-1,Picture
    Public Property Get DPicture() As Picture
        Set DPicture = d.Picture
    End PropertyPublic Property Set DPicture(ByVal New_DPicture As Picture)
        Set d.Picture = New_DPicture
        PropertyChanged "DPicture"
    End Property'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
    'MappingInfo=c,c,-1,Picture
    Public Property Get CPicture() As Picture
        Set CPicture = c.Picture
    End PropertyPublic Property Set CPicture(ByVal New_CPicture As Picture)
        Set c.Picture = New_CPicture
        PropertyChanged "CPicture"
    End Property'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
    'MappingInfo=a,a,-1,ScaleWidth
    Public Property Get APWidth() As Single
        APWidth = a.ScaleWidth
    End PropertyPublic Property Let APWidth(ByVal New_APWidth As Single)
        a.ScaleWidth() = New_APWidth
        PropertyChanged "APWidth"
    End Property'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
    'MappingInfo=a,a,-1,ScaleHeight
    Public Property Get AHeight() As Single
        AHeight = a.ScaleHeight
    End PropertyPublic Property Let AHeight(ByVal New_AHeight As Single)
        a.ScaleHeight() = New_AHeight
        PropertyChanged "AHeight"
    End Property'Load property values from storage
    Private Sub UserControl_ReadProperties(PropBag As PropertyBag)    Set Picture = PropBag.ReadProperty("APicture", Nothing)
        Set Picture = PropBag.ReadProperty("BPicture", Nothing)
        Set Picture = PropBag.ReadProperty("DPicture", Nothing)
        Set Picture = PropBag.ReadProperty("CPicture", Nothing)
        a.ScaleWidth = PropBag.ReadProperty("APWidth", 4620)
        a.ScaleHeight = PropBag.ReadProperty("AHeight", 3420)
    End Sub'Write property values to storage
    Private Sub UserControl_WriteProperties(PropBag As PropertyBag)    Call PropBag.WriteProperty("APicture", Picture, Nothing)
        Call PropBag.WriteProperty("BPicture", Picture, Nothing)
        Call PropBag.WriteProperty("DPicture", Picture, Nothing)
        Call PropBag.WriteProperty("CPicture", Picture, Nothing)
        Call PropBag.WriteProperty("APWidth", a.ScaleWidth, 4620)
        Call PropBag.WriteProperty("AHeight", a.ScaleHeight, 3420)
    End Sub'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
    'MemberInfo=14
    Public Function FlashB() As VariantEnd Function'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
    'MemberInfo=14
    Public Function FlashC() As VariantEnd Function'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
    'MemberInfo=14
    Public Function FlashD() As VariantEnd Function
      

  2.   

    大小:就是放大和缩小了(象ACDsee中的那个)!
    闪烁:就是有动感那种
    谢谢
      

  3.   

    大小:改变一下picture的大小不行吗?
      

  4.   

    建议当然有啦!!
    闪烁?在前面加个SPACE控件,动态更改它的属性值反色或透明,就达到了效果至于拉大拉小,其实你只要在PICTUREBOX中放个IMAGE控件,让它放图片,就非常好控制了.哈哈,分分拿来!
      

  5.   

    过程复杂,思路简单.使用PICTUREBOX的PaintPicture 方法.
      

  6.   

    参考下面语句.PicObj 目标图,PicSour 源图,PW 源图宽度,PH 源图高度,Size 放大或缩小的倍率.
    PicObj.PaintPicture PicSour.Picture, 0, 0, PW * Size, PH * Size, 0, 0,PW, PH原图是隐藏的,目标图用于显示.