Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Compact paths?

Compact paths?

Scheduled Pinned Locked Moved C#
csharpdotnetjsonquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dominik Reichl
    wrote on last edited by
    #1

    Hello! I'm looking for a function which I can give a file path and a number of pixels. The function should remove enough characters of the path and replace them by "..." to fit into the given amount of pixels. The PathCompactPath Win32 API function does this, but is there also a managed equivalent in the .NET framework? Thanks and best regards Dominik


    _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;) (doesn't work on NT)

    W 1 Reply Last reply
    0
    • D Dominik Reichl

      Hello! I'm looking for a function which I can give a file path and a number of pixels. The function should remove enough characters of the path and replace them by "..." to fit into the given amount of pixels. The PathCompactPath Win32 API function does this, but is there also a managed equivalent in the .NET framework? Thanks and best regards Dominik


      _outp(0x64, 0xAD); and __asm mov al, 0xAD __asm out 0x64, al do the same... but what do they do?? ;) (doesn't work on NT)

      W Offline
      W Offline
      Werdna
      wrote on last edited by
      #2

      If you're drawing your text using GDI+, you can use StringFormat class and set Trimming to EllipsisCharacter. If you need it in a control, you can easily create custom control that does all the drawing and uses appropriate Trimming flag.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups