阅读:1431回复:2
求助!拖动放大有问题!
<P >我的拖动放大有问题!希望各位大虾解决!</P>
<P ><p><FONT face="Times New Roman"> </FONT></p></P> <P >通用里写:<FONT face="Times New Roman">Dim r As New MapObjects2.Rectangle</FONT></P> <P ><p><FONT face="Times New Roman"> </FONT></p></P> <P ><FONT face="Times New Roman">Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)</FONT></P> <P ><FONT face="Times New Roman"> If Button.Key = "</FONT>放大<FONT face="Times New Roman">" Then ‘</FONT>我的工具栏中“放大”的按钮的关键字是“放大”<p></p></P> <P ><FONT face="Times New Roman"> flg = 2 ‘</FONT>如果点击“放大”按钮,则置<FONT face="Times New Roman">flg</FONT>为<FONT face="Times New Roman">2<p></p></FONT></P> <P ><FONT face="Times New Roman">End If</FONT></P> <P ><FONT face="Times New Roman">End sub</FONT></P> <P ><p><FONT face="Times New Roman"> </FONT></p></P> <P ><FONT face="Times New Roman">Private Sub Map1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ‘</FONT>此为实现拖动放大的函数<p></p></P> <P ><FONT face="Times New Roman"> If flg = 2 Then<p></p></FONT></P> <P ><FONT face="Times New Roman"> Set r = Map1.TrackRectangle<p></p></FONT></P> <P ><FONT face="Times New Roman"> Set Map1.Extent = r<p></p></FONT></P> <P ><FONT face="Times New Roman"> Map1.Refresh<p></p></FONT></P> <P ><FONT face="Times New Roman"> End If</FONT></P> <P ><FONT face="Times New Roman">End sub</FONT></P> <P ><p><FONT face="Times New Roman"> </FONT></p></P> <P >原图:</P> <P ><v:shapetype><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path connecttype="rect" gradientshapeok="t" extrusionok="f"></v:path><lock aspectratio="t" v:ext="edit"></lock></v:shapetype></P> <P ><p></p> </P> <P ><p><v:shapetype> <v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path connecttype="rect" gradientshapeok="t" extrusionok="f"></v:path><lock aspectratio="t" v:ext="edit"></lock></v:shapetype><v:shape><v:imagedata></v:imagedata></v:shape> </p></P> <P ><p><FONT face="Times New Roman"> </FONT></p></P> <P >放大后成了这个造型:<v:shapetype> </v:shapetype></P> <P ><v:shapetype stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" preferrelative="t" spt="75" coordsize="21600,21600"></v:shapetype> </P> <P ><v:shapetype stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" preferrelative="t" spt="75" coordsize="21600,21600"><v:shapetype> <v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path connecttype="rect" gradientshapeok="t" extrusionok="f"></v:path><lock aspectratio="t" v:ext="edit"></lock></v:shapetype><v:shape><v:imagedata></v:imagedata></v:shape></v:shapetype></P> <P ><v:shapetype stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" preferrelative="t" spt="75" coordsize="21600,21600"></v:shapetype> </P> <P >希望大虾帮我解决这个问题!我在这里跪谢了!</P><img src="images/post/smile/dvbbs/em12.gif" /> |
|
1楼#
发布于:2007-06-13 22:55
<P>写入下面代码,还需要在点击放大按钮后把鼠标样式设置成Map1.MousePointer=moZoomIn </P>
<P>Private Sub Map1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)<BR>If Button = vbLeftButton Then<BR> Select Case Map1.MousePointer<BR> Case moZoomIn '放大<BR> Map1.Extent = Map1.TrackRectangle<BR> Set r = Map1.Extent: r.ScaleRectangle 0.8: Map1.Extent = r:<BR> Case moZoomOut '缩小<BR> Set r = Map1.Extent: r.ScaleRectangle 1.5: Map1.Extent = r:<BR> Case moPan And Button = 1 '漫游<BR> Map1.Pan<BR> End Select<BR>End If<BR>End Sub</P><img src="images/post/smile/dvbbs/em07.gif" /><img src="images/post/smile/dvbbs/em08.gif" /> |
|
2楼#
发布于:2007-06-08 10:25
<P>就是放大的部分总是在map1未显示出来的左下角!每次都要把map1向右上角拖,使左下角显示出来,被放大的图层才能看得见!</P>
|
|