[RESOLVED] What is the API function for convert any scale for twips or characters?-VBForums
Results 1 to 7 of 7

Thread: [RESOLVED] What is the API function for convert any scale for twips or characters?

  1. #1

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    2,919

    Resolved [RESOLVED] What is the API function for convert any scale for twips or characters?

    i understand that, normaly, the API functions works in pixels or in the client coordinates. but imagine that i need convert that coordenates to character or twips, what function can i use?
    VB6 2D Sprite control

    To live is difficult, but we do it.

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    3,146

    Re: What is the API function for convert any scale for twips or characters?

    I believe you'll have to call the SetMapMode function. See Mapping Modes and Translations for additional details.
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  3. #3

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    2,919

    Re: What is the API function for convert any scale for twips or characters?

    Quote Originally Posted by Bonnie West View Post
    I believe you'll have to call the SetMapMode function. See Mapping Modes and Translations for additional details.
    how can i declare SetMapMode() in VB2010?
    VB6 2D Sprite control

    To live is difficult, but we do it.

  4. #4
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    3,146

    Re: What is the API function for convert any scale for twips or characters?

    I don't know to declare it in VB2010, but in VB6, you would declare the 2 parameters and the return value of SetMapMode As Long, that is, they are all 32 bits wide (4 Bytes).
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  5. #5

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    2,919

    Re: What is the API function for convert any scale for twips or characters?

    Quote Originally Posted by Bonnie West View Post
    I believe you'll have to call the SetMapMode function. See Mapping Modes and Translations for additional details.
    ok..thanks for all
    if MM_TEXT is for pixels, what is for text scalemode? is the MM_TWIPS?
    VB6 2D Sprite control

    To live is difficult, but we do it.

  6. #6
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    3,146

    Re: What is the API function for convert any scale for twips or characters?

    Quote Originally Posted by joaquim View Post
    if MM_TEXT is for pixels, what is for text scalemode? is the MM_TWIPS?
    If by "text" you mean character (as you've mentioned above), then according to VB6's ScaleX, ScaleY Methods:

    vbCharacters 4 Character (horizontal = 120 twips per unit; vertical = 240 twips per unit).

    To convert any scalemode to Character, it must be converted first to Twips.



    BTW, doesn't VB2010 have methods equivalent to VB6's ScaleX and ScaleY methods?
    Last edited by Bonnie West; Aug 13th, 2013 at 09:16 AM.
    On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
    Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)

  7. #7

    Thread Starter
    PowerPoster joaquim's Avatar
    Join Date
    Apr 2007
    Posts
    2,919

    Re: What is the API function for convert any scale for twips or characters?

    Quote Originally Posted by Bonnie West View Post
    If by "text" you mean character (as you've mentioned above), then according to VB6's ScaleX, ScaleY Methods:

    vbCharacters 4 Character (horizontal = 120 twips per unit; vertical = 240 twips per unit).

    To convert any scalemode to Character, it must be converted first to Twips.



    BTW, doesn't VB2010 have methods equivalent to VB6's ScaleX and ScaleY methods?
    no... they put pixel by defauld. but i'm trying don't need convert them too
    thanks for all
    VB6 2D Sprite control

    To live is difficult, but we do it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.