Tech Off Thread

9 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Two WPF questions, Images and Labels

Back to Forum: Tech Off
  • User profile image
    Pon

    I'll ask the Image quesiton first:
    How does one set an individual pixel on an image? I know one has to create a BitmapSource, but I don't know what to do from there. I need this to be as quick as possible; it's for a software 3d engine Tongue Out

    Second, how do you create a hyperlink in a label that responds to events? I'm sure you all know what I mean, but I can't explain it well lol.

  • User profile image
    littleguru

    Does WPF no longer have the LinkLabel control?
    I heard once that you need to apply a filter on the bitmap source... but I haven't done anything with WPF yet... somebody mentioned that in a video on Channel 9.

  • User profile image
    Pon

    The LinkLable control isn't in Sparkle, anyway Sad

  • User profile image
    mawcc

    Regarding the hyperlink try something like this:

    <TextBlock>Click <Hyperlink NavigateUri="http://channel9.msdn.com">here</Hyperlink></TextBlock>">http://channel9.msdn.com">here</Hyperlink></TextBlock>

    At least this works in WPF Web Browser Applications. I couldn't get HTTP-Links to work in WPF Windows Applications. In this case you might want to add a Click-Handler to the Hyperlink and open the URL using

    System.Diagnostics.Process.Start( "http://channel9.msdn.com" );

  • User profile image
    littleguru

    mawcc wrote:
    Regarding the hyperlink try something like this:

    <TextBlock>Click <Hyperlink NavigateUri="http://channel9.msdn.com">here</Hyperlink></TextBlock>">http://channel9.msdn.com">here</Hyperlink></TextBlock>

    At least this works in WPF Web Browser Applications. I couldn't get HTTP-Links to work in WPF Windows Applications. In this case you might want to add a Click-Handler to the Hyperlink and open the URL using

    System.Diagnostics.Process.Start( "http://channel9.msdn.com" );



    Ah yes. This makes a lot more sense. We should think more to nest controls. This is more XML and nesting now Smiley

  • User profile image
    footballism

    Pon wrote:
    I'll ask the Image quesiton first:
    How does one set an individual pixel on an image? I know one has to create a BitmapSource, but I don't know what to do from there. I need this to be as quick as possible; it's for a software 3d engine Tongue Out


    I've posted a sample in the following MSDN WPF forum thread on how to manipulate pixels in WPF (with a bit of WPF/GDI+ interop code):
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2424599&SiteID=1

    Pon wrote:

    Second, how do you create a hyperlink in a label that responds to events? I'm sure you all know what I mean, but I can't explain it well lol.


    Hyperlink is "navigation service" aware, which means it can work properly as you expect in navigation application(using NavigationWindow, Frame which can provide navigation service).

    In standalone non-navigation application, you can hook up to its Click event, and implement the navigation logic there.

    PS: If you have any more question on WPF, you can ask questions in MSDN WPF Forum.

    I am moderator there, and will always be ready to help:)

  • User profile image
    Ion Todirel

    footballism wrote:
    I am moderator there, and will always be ready to help
    you said it Tongue Out btw sience when, do you work for MS or something? looks like... yes Smiley

  • User profile image
    footballism

    Ion Todirel wrote:
    
    footballism wrote:
    I am moderator there, and will always be ready to help
    you said it btw sience when, do you work for MS or something? looks like... yes


    Yes, sort of work for them. They offer me a vendor position and ask me to manage the MSDN WPF forum:)


  • User profile image
    blagoev

    I have implemented a WPF LinkLabel check it out here

    http://blagoev.com/Blog/post/Building-a-WPF-LinkLabel-control.aspx

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.