Home > Software engineering >  Why do you write code or in the map can't show the text box input at two o 'clock?
Why do you write code or in the map can't show the text box input at two o 'clock?

Time:10-08

 Private Sub Command1_Click () 
Rem draw point
Picture1. Cls
Picture1. PSet (Val (Text1. Text), Val (Text2. Text)), vbRed
Picture1. PSet (Val (Text3. Text), Val (Text4. Text)), vbRed
End Sub

Private Sub Form_Load ()
StrMap="d: \ VBPRO \ map. JPG" 'please enter here the map image's address
Picture1. Picture=LoadPicture (strMap) 'load the map image
Picture1. Cls
Picture1. AutoRedraw=True
Picture1. DrawWidth=5
Picture1. Picture=LoadPicture (strMap)
Picture1. Scale (34.5945905, 119.2236247) - (34.6087173, 119.19137113) 'define the coordinate system, the upper left corner (0180), the bottom right hand corner (90, 0) this depends on the actual situation
End Sub

So why still can't write code in the map shows the text box input points? Trouble you to help

CodePudding user response:

Text box input number in decline after coordinate transformation to the Picture1 in pixel coordinates range,
I guess,

CodePudding user response:


Scale method


Used to define the Form, PictureBox or Printer coordinate system, does not support named parameters,

Syntax

Object Scale (x1, y1) - (x2, y2)

Scale method syntax includes the following parts:

Part of the description
Object optional, an object expression, its value is "applied" in the list of an object, if you omit the object, the Form object with a focus on the default as object,
X1, y1 optional, all are single precision value, indicating the top left corner of the object defined level (x axis) and vertical (y - axis) coordinates, these values must be enclosed in brackets, if omitted, the second set of coordinates must also be omitted,
X2, y2 optional, all are single precision value, indicating defined object at the bottom right of the horizontal and vertical coordinates of these values must be enclosed in brackets, if omitted, then the first set of coordinates must also be omitted,


Description

Scale method will enable you to coordinate system reset to the choice of any Scale, Scale of runtime graphics statements have affected, and the coordinate system for position control,

If used with no parameters Scale (two sets of coordinates are omitted), coordinate system will be reset to twips,


ScaleMode property


When using the graphical method or adjust the control position, gets or sets a value, a measure of the value indicates the object coordinates,

Syntax

Object. The ScaleMode [=value]

ScaleMode attribute grammar contains the following parts:

Part of the description
Object expression, and its value is "applied" in the list of an Object,
The Value of a specified unit of measure integer, there is a detailed description in "Settings",


Set the value

The value of the setting value is:

The setting of the constant description
VbUser 0 points out ScaleHeight ScaleWidth, ScaleLeft and ScaleTop properties of one or more of the value is set to custom,
VbTwips 1 (the default) twips (every inch to 1440 twips logic; Each logical centimeters in 567),
VbPoints 2 pounds (72 pounds) per logical inches for,
VbPixels 3 pixel (the smallest unit of a monitor or printer resolution),
VbCharacters 4 characters (level=120 twips per unit; Each unit=240 twips, vertical)
VbInches 5 inches,
VbMillimeters 6 mm,
VbCentimeters 7 cm,
8 HiMetric VbHimetric
VbContainerPosition 9 controls container unit, position control,
VbContainerSize 10 containers use control unit, decided to control the size of the


Description

Relevant ScaleHeight ScaleWidth, ScaleLeft and ScaleTop attributes to use, can set up with a positive, negative coordinate the custom of coordinate system, the four Scale and ScaleMode attribute interactions in the following way:

Put any other Scale property is set to any value will ScaleMode automatically set to 0, the ScaleMode equals 0 is user-defined,


The ScaleMode property is set to a number greater than zero, will make ScaleHeight ScaleWidth and unit of measure of the change, and will be ScaleLeft and ScaleTop is set to 0, CurrentX and CurrentY set values will change to reflect the new coordinates of points,
  • Related