Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.
Cell[TextData[{ "(16) ", ButtonBox["[images]",  BaseStyle->"Hyperlink",  ButtonData->{"http://i.stack.imgur.com/gHWby.png", None}]}], "Text"]

After click the link, then open one notebook, however it's in bad encoding?

enter image description here

My $CharacterEncoding is CP936, I'm not sure whether this is related, I'm on Windows, maybe someone's environment will show the linked image good?

share|improve this question
1  
This occurs because you are opening the PNG file directly in the front end. Try importing it as an image instead. –  Oleksandr R. Jul 8 '13 at 4:06
    
@OleksandrR. I encountered with this by accident. So I'm not sure whether this is one feature of Mathematica. Because sometimes when we add links of web images, then click just comes out the System Internet Explorer. –  HyperGroups Jul 8 '13 at 4:10
1  
I don't know why that happens. If that's what you want, though, you can use SystemOpen. –  Oleksandr R. Jul 8 '13 at 4:13
    
@OleksandrR. SystemOpen is ok, but in this case, I just wanna image show in Mathematica's new open notebook, something like Latex's formula preview or MathML window in SE, I just think it maybe developed by some setting about encoding that makes this action like as expected. Also something like a button on the image link, and then Import and show the image(or image's codes) in one New open Notebook. –  HyperGroups Jul 8 '13 at 6:05
    
I don't know if I understand what you want, but does this help at all? CellPrint@Cell[ TextData[{ "(16) ", ButtonBox["[images]", Evaluator -> Automatic, BaseStyle -> "Hyperlink", ButtonFunction -> (Print @ Import @ # &), ButtonData -> "http://i.stack.imgur.com/gHWby.png"]}], "Text"] –  Mr.Wizard Jul 8 '13 at 17:20
show 1 more comment

1 Answer

up vote 2 down vote accepted

I assume that you are finding a way to open images in a new notebook, so this might be of help:

nb = CreateDocument[];
NotebookWrite[nb, 
Cell[BoxData[ToBoxes[
          Import["http://i.stack.imgur.com/gHWby.png"]
    ]]]]
share|improve this answer
1  
Yes, this is one possible way, but I'm more curious to know whether there would be possible to set some options, and make the example I figured works well. –  HyperGroups Jul 8 '13 at 7:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.