请问如果要做成和“画图”程序的图片处理效果,
象放大图片后,图片的属性不变,即宽度、高度不变,
(在“图像”->“属性”里可查看到),在VB里该怎样做?
有什么思路?需用到什么函数来处理图片的放大缩小?
谢谢~~~~~~~~~~~

解决方案 »

  1.   

    http://www.showyou.net/mycode/CodeView/CodeView_1452.html
    http://www.showyou.net/mycode/CodeDown.asp?ID=2867&lbID=0
      

  2.   

    Option Explicit
    Private Const ratio_small As Single = 0.5
    Private Const ratio_large As Single = -1#Private Sub Zoom(ByVal img As Image, ByVal ratio As Single)
        img.Stretch = True
        img.Left = img.Left + img.Width * ratio / 2#
        img.Top = img.Top + img.Height * ratio / 2#
        img.Width = img.Width - img.Width * ratio
        img.Height = img.Height - img.Height * ratio
    End SubPrivate Sub Command1_Click()
        Zoom Image1, ratio_small
    End SubPrivate Sub Command2_Click()
        Zoom Image1, ratio_large
    End Sub
      

  3.   

    我要做的效果是这样的:
        就象“画图”程序里,当打开一幅图片后,移动鼠标随便找一个点,这时在“画图”的下面工具栏右边可以看到该点的像素(X、Y坐标),如果将图片放大后,再移动鼠标到该点上,看到的像素(X、Y坐标)还是一样的,没有变化。