best way to show several images on a winform in c#? Datagrid?
Several PictureBoxes :-)
Left a treeview with all the images and mainform the image large? It's kinda hard to guess what you want...
My company, Atalasoft, has several win forms controls that can be used for displaying images and thumbnails.
There is a typical example of using the thumbnail control here.
It depends on how many images you want to display, do you want thumbnails or full-resolution images?
I'm going to assume that since you asked for "images", you have many images to display. As such, you'll probably be wanting to use thumbnails on that form, with a different form if you want to display the full-resolution image.
In this case, you'll want to look at the ImageList object in conjunction with the ListView object.
I used this solution in an app recently. It worked out very well.
You can try using an ImageList and binding it to a ListView. You can set the ListView to Tile View state or any other states.
Related
I want to show nearly 500 images serially in my e-catalogue application.
It should be like panorama view, the half of the image appear in the first screen when drag the next half will appear. Like that I have to show 500 jpeg images like a ebook application. Which is the best way?
I have tried it in panorama using selection changed event but it can't load quickly. Kindly guide me.
try load the two first image (1.jpeg and 2.jpeg) and with the event, when you are on 2.jpeg (load another image (3.jpeg))
Another alternative is using virtual paging an article with sample project can be found here
http://kent-boogaart.com/blog/virtual-paging-in-silverlight
When the user clicks a button in my C# app I want to show him bunch of images so that he can pick one. I don't want to do it with file browser, I want him to be able to view little thumbnails of the images so that he sees what he is picking.
Is there any control I can use to do this?
Thanks
If you are refering to a WinForms control, I would recommend the free ImageListView control.
Works very well in my own real-world projects. Plus, the author is very responsive and the control seems to have a very high overall code and design quality.
You will need to create custom code. Or you can use a WYSIWYG Editor.
Here are 2 popular ones for .NET.
http://www.tinymce.com/
http://ckeditor.com/
Create multiple PictureBox-es in a grid formation in the form that you are creating.
Display one thumbnail in each PictureBox.
I am usually against PictureBox control usage, but in this case, you can't miss.
I have an idea for a personal project. And I know one way of accomplishing it in Windows Forms (which I no longer wish to use). Basically I could (in WinForms) just draw everything onto the screen (Form) and then when I need to switch views/states of the application, just redraw the new stuff in the old stuff's place.
But how can we have different states in WPF? Is there a "right" or "proper" way of doing this? Is something like this covered somewhere in the docs?
I'd like to do my own searching, but I have no idea what exactly to look for, and current attempts at finding the right information, so far have yielded no helpful (or even relevant) results.
Any help at all will be greatly appreciated. I am new to WPF, but have been making a lot of progress this past week!
Thank you!
P.S.:
I just thouhght of something. If the solution was to draw what is needed for one screen, and when it is time to display the next screen, just dispose of/hide everything and create/display the new stuff, then how would we get around this? Because we can't/shouldn't change XAML markup at runtime, can/should we? :/
Not sure how you drawn your views/states in WinForms (direct painting on a Graphics object?).
The closest to what you're describing is the VisualStateManager. You can use it to statically define several visual states inside a single XAML and transit between them (using a smooth animation if you want).
If what you've done was show different Forms with Show/ShowDialog(), then the equivalent would be to use different Windows and Show/Hide them.
If you just cleared/added Controls to your form, then you can do just the same in WPF. Most Controls in WPF have a Content or Children property instead of Control.Controls in Forms.
I don't know if I understand what you really want. But here are my thoughts:
You can use several Windows and Show/Hide them accordingly
You can use the Frame/Page functionality in WP (MSDN)
if you really need to you could load your XAML and remove the topmost content in your Window and replace it with the loaded content
You could use the VisualStateGroup functionality to change the appearance of your current window
I think you will be happy with the second solution
So, i have tossed around a few ideas, and would like to add animated emoticons to my chat app. Currently, in AutoIT, i use an HTML page to display those when a user clicks on a static image. That, obviously, isn't ideal.
Is there a way to display all of my animated GIF's (emoticons) either via an ImageList and still have them animated say inside of a listview? ComboBox?
What would be the best way to do emoticons inside of Windows Forms (displaying)?
I think you might want to turn to WPF rather than forms: How do I get an animated gif to work in WPF?
(following comments I am adding this link to the answer as well)
If you want to use WPF in a forms enviroment, use the ElementHost tag: http://msdn.microsoft.com/en-us/library/system.windows.forms.integration.elementhost%28v=VS.90%29.aspx?appId=Dev10IDEF1&l=EN-US&k=k%28SYSTEM.WINDOWS.FORMS.INTEGRATION.CHILDCHANGEDEVENTARGS%29;k%28TargetFrameworkMoniker-%22.NETFRAMEWORK&k=VERSION=V3.5%22%29;k%28DevLang-CSHARP%29&rd=true
I wanted to make the listview show thumbnails only when the items are visible on the screen.
Is there a way to do this?
See an excellent implementation of what your after on CodeProject
You can do this by using a ListView in virtual mode, and then adding your generated thumbnails to the LargeImageList during the RetrieveVirtualItem event (if they are not already there).
If you wanted most of the work done for you, you could use a FastObjectListView from the ObjectListView project (an open source wrapper around .NET WinForms ListView) and then follow this recipe on how to use images loaded from a database. Your images, of course, would be thumbnails created from the source rather than images from a database but the logic is the same.