我主要是想把image中显示的图片放大
 不知道怎么实现它。VB新手不懂。向高手请教!
一个窗体,一个text 一个combo 一个image 一个picture 四个command组成
 我的目的是想:
   1.单击command1将text1中的text显示到combo1中
   2.单击command2将显示combo1内选中的一张原始大小的图片显示到image1中
   3.每单击一次command3将image1中显示的图片放大原始图片的0.5倍并显示到picture1中
   4.每单击一次command4将picture1中所显示的图片按目前picture1中的图片缩小0.3倍
我现在用的代码为:
Private Sub Form_Load()
Text1.Text = ""
Command1.Caption = "添加目录"
Command2.Caption = "显示原始图片"
Command3.Caption = "放大图片"
End Sub
Private Sub Command1_Click()
Combo1.AddItem Text1.Text
End SubPrivate Sub Command2_Click()
Image1.Picture = LoadPicture(Combo1.Text)
End Sub之后的代码我写不出来了。请高手帮下忙。感激不尽!~~~~
 本人QQ:149184919 天天在线10小时

解决方案 »

  1.   

    增加4个按扭Command1 Command2 Command3 Command4
    增加一个文本框      Text1
    增加一个下拉列表框  Combo1
    增加一个图片框      Image1
    增加一个相片框      Picture1
    Private Sub Command1_Click()
    Combo1.AddItem Text1.Text
    End SubPrivate Sub Command2_Click()
    Image1.Picture = LoadPicture(Combo1.Text)
    End SubPrivate Sub Command3_Click()
    Picture1.Width = Image1.Width / 2
    Picture1.Height = Image1.Height / 2
    Picture1.AutoRedraw = True
    Picture1.AutoSize = True
    Picture1.PaintPicture Image1.Picture, 0, 0, Image1.Width / 2, Image1.Height / 2
    End SubPrivate Sub Command4_Click()
    Picture1.Width = Image1.Width * 0.5 * 0.3
    Picture1.Height = Image1.Height * 0.5 * 0.3
    Picture1.AutoRedraw = True
    Picture1.AutoSize = True
    Picture1.PaintPicture Image1.Picture, 0, 0, Image1.Width * 0.5 * 0.3, Image1.Height * 0.5 * 0.3
    End SubPrivate Sub Form_Load()
    Text1.Text = ""
    Command1.Caption = "添加目录"
    Command2.Caption = "显示原始图片"
    Command3.Caption = "0.5倍图片"
    Command4.Caption = "再小0.3倍图片"Combo1.AddItem "C:\WINDOWS\Web\Wallpaper\Bliss.bmp"
    Image1.Stretch = FalseEnd Sub
      

  2.   

    不行啊。一点command3 command4就会出错。
      

  3.   

    点击command3和command4都会出错。
     帮我解决下这个问题。
      

  4.   

    Picture1.Width = Image1.Width / 2Picture1.Width = Image1.Width * 0.5 * 0.3以上两句都出错了。刚好一个在command3 一个在command4里
      

  5.   

    Private Sub Command1_Click()
    Combo1.AddItem Text1.Text
    End SubPrivate Sub Command2_Click()
    Image1.Picture = LoadPicture(Combo1.Text)
    End SubPrivate Sub Command3_Click()
    Picture1.Width = Image1.Width / 2
    Picture1.Height = Image1.Height / 2
    Picture1.AutoRedraw = True
    Picture1.AutoSize = True
    Picture1.PaintPicture Image1.Picture, 0, 0, Image1.Width / 2, Image1.Height / 2
    End SubPrivate Sub Command4_Click()
    Picture1.Width = Image1.Width * 0.5 * 0.3
    Picture1.Height = Image1.Height * 0.5 * 0.3
    Picture1.AutoRedraw = True
    Picture1.AutoSize = True
    Picture1.PaintPicture Image1.Picture, 0, 0, Image1.Width * 0.5 * 0.3, Image1.Height * 0.5 * 0.3
    End SubPrivate Sub Form_Load()
    Text1.Text = ""
    Command1.Caption = "添加目录"
    Command2.Caption = "显示原始图片"
    Command3.Caption = "0.5倍图片"
    Command4.Caption = "再小0.3倍图片"Combo1.AddItem "C:\WINDOWS\Web\Wallpaper\Bliss.bmp"
    Image1.Stretch = FalseEnd Sub我用的是一个text 一个combo 一个image 一个picture 和四个command
      

  6.   

    不会说,窗体里面没有加入Picture1的 PictureBOX控件吧?》