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. WPF
  4. Blurry Borderline In FlowDocument

Blurry Borderline In FlowDocument

Scheduled Pinned Locked Moved WPF
question
3 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.
  • F Offline
    F Offline
    FocusedWolf
    wrote on last edited by
    #1

    It seems no amount of SnapsToDevicePixels="True" and/or UseLayoutRounding="True" can make the border around a Paragraph sharp:

                        A button
                    
                
            
            
            A button
                    
                
            
            
            A button
    

    However i can use RenderOptions.EdgeMode="Aliased" which makes the border sharp, but distorts the Expander:

                        A button
    

    So, is there any way to make the border sharp without hurting the documents appearance? :-D

    L 1 Reply Last reply
    0
    • F FocusedWolf

      It seems no amount of SnapsToDevicePixels="True" and/or UseLayoutRounding="True" can make the border around a Paragraph sharp:

                          A button
                      
                  
              
              
              A button
                      
                  
              
              
              A button
      

      However i can use RenderOptions.EdgeMode="Aliased" which makes the border sharp, but distorts the Expander:

                          A button
      

      So, is there any way to make the border sharp without hurting the documents appearance? :-D

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      If you placed the Expanders (with a border) "outside" the FlowDocument (in a FrameworkElement), you could use UseLayoutRounding to get the effect you want. As presented, I don't see why these expanders have to be inside a FlowDocument (which isn't a FrameworkElement).

      F 1 Reply Last reply
      0
      • L Lost User

        If you placed the Expanders (with a border) "outside" the FlowDocument (in a FrameworkElement), you could use UseLayoutRounding to get the effect you want. As presented, I don't see why these expanders have to be inside a FlowDocument (which isn't a FrameworkElement).

        F Offline
        F Offline
        FocusedWolf
        wrote on last edited by
        #3

        Ok i figured out a way that works, although its a bit ugly:

                                A button
        

        As for why, my code is based on this: http://stackoverflow.com/questions/3798262/how-to-collapse-a-paragraph although i've been improving it. The idea is add or remove a paragraph block below the expander block based on the state of the expander. That + code to handle the copy to clipboard to convert the uielements to text (in this case, getting the header string of the expander) and the result is an interactive flowdocument with collapsing regions and copy support.

        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