Answered Help required regarding WpfDiscipleBlogViewer3D

  • 1 สิงหาคม 2555 7:21
     
     
    Hello All, 
     
    I am creating an application which takes some screen shots and save them in a folder say for example "images" . 
     
    Now my next task is to show these images in thumbnail view , for this I am thinking about using WpfDiscipleBlogViewer3D ,
     
    A really nice application. which i download from Conceptual Children: A powerful new concept in WPF[^]
     

    I have almost integrated this but i am facing problem in showing images , Above application by DR. WPF uses XML file named blogroll.xml for input of data , 
     
    But I want it to show all images dynamically from a folder named "images" , means it should automatically load all images that folder when application starts. 
     
    Can Anyone help me out , I know i am not able to explain my question well , so you can ask me for any detail 
     
    Please help me 
     
    Ashish

ตอบทั้งหมด

  • 2 สิงหาคม 2555 10:52
    ผู้ดูแล
     
     คำตอบ มีโค้ด

    Hi Ashish,

    I check the sample you provide, and in the xml file stores all pictures' path to ready for the databinding.

    In the sample image is in one folder called images as you can see also. According to your description, I think you want to directly show picture in xaml file when loaded without binding, right? Due to you don't want to use binding, thus you need to add each image you want into ListBox to achieve your goal. Just like below code for your reference:

     <ListBox>
                <ListBoxItem>
                    <ListBoxItem.Template>
                        <ControlTemplate>
                            <Button
                  Command="Open"
                  CommandParameter="url1"
                  Cursor="Hand"
                  Focusable="False"
                  >
                                <Button.Template>
                                    <ControlTemplate TargetType="Button">
                                        <Border
                        Background="Black"
                        BorderBrush="#88000000"
                        BorderThickness="0.5"
                        Padding="1"
                        >
                                            <DockPanel>
                                                <Button
                            Background="Transparent"             
                            Command="Open"
                            CommandParameter="bio1"
                            Content="author1"
                            DockPanel.Dock="Top"
                            Focusable="False"
                            Foreground="White"
                            HorizontalAlignment="Stretch"
                            Margin="-14,-8,-12,8"
                            ToolTip="Read author's bio"
                            />
                                                <Image Source="pic1" />
                                            </DockPanel>
                                        </Border>
                                    </ControlTemplate>
                                </Button.Template>
                            </Button>
                        </ControlTemplate>
                    </ListBoxItem.Template>
                </ListBoxItem>
            </ListBox>

    Hope it helps.

    If I misunderstood you, please feel free to let me know.

    Have a nice day.


    Annabella Luo[MSFT]
    MSDN Community Support | Feedback to us

    • ทำเครื่องหมายเป็นคำตอบโดย ashessitm 14 กุมภาพันธ์ 2556 6:18
    •  
  • 3 สิงหาคม 2555 5:32
     
     

    I do not have any problem with binding , Only problem is that I am not able to show my pictures with binding . 

    If you had seen the sample source you would have seen that all pictures link is given in blogroll.xml file and pictures are stored in "images" folder.

    So initially i though that I should also follow the same process , and i would edit blogroll.xml file and will put pictures in "images" folder

     So if we put a new picture (say ashish.jpg) in "images" folder and give link in blogroll.xml

     (for example   <blog author="Ashish" bio="http://ashes.com/ash/" pic="images/ashish.jpg" url="http://ashes.com/" /> )

    Then logically it should show the picture because i have done almost every formalities required , but it won't show the image ,

    Now if I right click "images"  folder from visual studio and add that picture then it will show my picture . But this is not the practical solution . 

    I could not understood your answer at all , because i am not trying to show a single picture but a series of pictures .

    Ashish



    • แก้ไขโดย ashessitm 3 สิงหาคม 2555 5:51
    •  
  • 3 สิงหาคม 2555 8:01
    ผู้ดูแล
     
     

    Hi ashessitm,

    I got your problem now, you just want to add a your own picture and falied to show it on window, right?

    I test what you said on that sample app, and I have two picture, in which one can be show normally the other one can't be shown and exception in out putwindow said:

    "at System.Windows.Data.BindingExpression.ConvertHelper(IValueConverter converter, Object value, Type targetType, Object parameter, CultureInfo culture)'"

    And I try other more picture, all of them works good. So you can check if you get the same error information as what I post here when you try to add your owne picture. If yes, you can try add other picture instead to see if it is work, in my side broken image which show well in windows cause of blank in WPF window and destoy the binding.

    If your issue still exist, please feel free to let me know.

    Have a nice day.


    Annabella Luo[MSFT]
    MSDN Community Support | Feedback to us

  • 3 สิงหาคม 2555 10:18
     
     

    No Sir You have not understood my problem . Let me tell you in detail . 

    I am able to see my images by following these below 4 steps : 

    Step -1 ) Edit Blogroll.xml file 

    Step -2) Put my picture in "images"  folder from window explorer . 

    Step -3) Now I have to Open Visual Studio and from the Solution Explorer , right click the "Images" folder and then click Add Existing Item then common dialog box will appear and then select my image and add it. 

    Step -4) Now debug the application and Image will be shown without exception or any problem . 

    I simply want to remove this step - 3 .

    Hope I am able to explain my problem this time , When you tried with sample app , as u told in last  post , Did you follow the Step -3 ? 

    Ashish 

  • 6 สิงหาคม 2555 3:43
    ผู้ดูแล
     
     

    You do really need to ask your question in detail at first you start a thread, sir.

    I think this time I got your problem, for the four step you post here, you don't need to do the second step, to directly copy image into Solution Explorer will works greate.

    And VS can't directly get the change in Folder of window explorer.

    Hope it helps.

    Have a nice day.


    Annabella Luo[MSFT]
    MSDN Community Support | Feedback to us

  • 6 สิงหาคม 2555 6:00
     
     

    Sir , I want to make exe file of my application , after making exe file how can user follow step -3 of my above post , I wanted to eliminate step-3 not step-2 ,

    My biggest problem which i stated in my very first post that 

     I want it to show all images dynamically from a folder named "images" , means it should automatically load all images that folder when application starts. 

    It simply means that i do not want to show some fixed 8 -10 fixed pics every time to my users , My application divided into 2 parts , first part is taking snapshot of my screen and these snapshots and will save them as .jpg files in a floder named "images" (number of snapshots not fixed ) , and second part for which i was thinking of WpfDiscipleBlogViewer3D to show images , All these things i have mentioned in my first post . Every time images will be different so how can i add them as resources from visual studio at the time of making exe . 

    May be my English is not that good or i don't know what is the reason that no one is actually able to understand my problem , 

    This is my last try to explain before loosing all hopes ,

    Recently i found one sample from MSDN side of Photo Store Demo at http://msdn.microsoft.com/en-us/library/ms771354(v=vs.90) 

    In this application no need to add images from Solution Explorer it will simply show all images from an folder named "photos"  you can check it by putting some 5-10 extra pictures of your . I want this type of functionality in WpfDiscipleBlogViewer3D 

    This is my last try , Please Please help me out 

    Ashish Sharma


    • แก้ไขโดย ashessitm 6 สิงหาคม 2555 11:16
    •  
  • 7 สิงหาคม 2555 5:00
     
     คำตอบ
    After a long struggle , I am able to resolve my problem so closing this question now 
    • ทำเครื่องหมายเป็นคำตอบโดย ashessitm 7 สิงหาคม 2555 5:00
    •  
  • 7 สิงหาคม 2555 5:17
    ผู้ดูแล
     
     

    Hi ashessitm,

    It's greate to hear that you have resolved your issue, could you please share your solution with us so that other member who has the same question as yours will get a good solution?

    Thank you.

    Have a nice day.


    Annabella Luo[MSFT]
    MSDN Community Support | Feedback to us

  • 7 สิงหาคม 2555 6:16
     
     คำตอบ มีโค้ด

    Actually I dropped the idea of WpfDiscipleBlogViewer3D and opted for fluidkit  from http://fluidkit.codeplex.com/  , which infact has a better functionality than WpfDiscipleBlogViewer3D  . Since starting I was trying my hands on both application and yesterday finally got solution on fluidkit  . 

    My main problem was getting images directly from a specified folder without adding them as resources in Project , since i have to show different pictures every time . 

    i put below code in my application 

     

    string image path = "C:\Images" var imageDir = new DirectoryInfo(@imagePath); var images = new List<FileInfo>(imageDir.GetFiles("*.jpg"));

    // Above code is most important part which i was missing from last few day

    // It will load all image files even when they are not added as resources at the

    // time of making project , You can also use common dialog box to take input of

    //desired folder index= 0 ; foreach (FileInfo f in images) { BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi..UriSource = new Uri(f.FullName, Relative or Absolute ); bitmapImage.EndInit(); // now load images to your requirement // in my case it was mypics.Insert(index , bi); index++; }



    I did not tried the same with WpfDiscipleBlogViewer3D  but it can be done with similar logic .  

    Ashish


    • แก้ไขโดย ashessitm 7 สิงหาคม 2555 6:35
    • ทำเครื่องหมายเป็นคำตอบโดย Annabella LuoModerator 7 สิงหาคม 2555 6:46
    •  
  • 7 สิงหาคม 2555 6:46
    ผู้ดูแล
     
     
    Thank you for your sharing, ashessitm.

    Annabella Luo[MSFT]
    MSDN Community Support | Feedback to us