WPF Image Browsing, scrolling, and dragging controls

Source: Internet
Author: User

Organize images, Drag and Drop browsing, and scroll controls

 

Not to mention,

You can separately define the image size, display transparency, and so on, and provide them to external calls.

 

Public List < Wpf1_lkits. mutiimages. sypoimage > SLS =   New List < Sypoimage > ();

 

 

Code

SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q1.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q2.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q3.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q4.jpg " , " 150 " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q1.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q2.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q3.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q4.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q1.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q2.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q3.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q4.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q1.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q2.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q3.jpg " ));
SLS. Add ( New Sypoimage (environment. currentdirectory +   " \ Images \ q4.jpg " ));

Esimages. Width= 600;
Esimages. imagessource=SLS;

 

 

A special event is provided, which is triggered three seconds after hovering the cursor over an image.

CodeAs follows:

 

Code

Private   Void Window_loaded ( Object Sender, routedeventargs E)
{
Esimages. eventtimer + =   New Mutiimage. eventtime (esimages_eventtimer );
// 30 is 3 seconds, in 0.1 seconds
Esimages. etimerstart ( 30 );

}< br> // event
void esimages_eventtimer (image imgcurr)
{< br> MessageBox. show ( " test image: " + imgcurr. source. tostring ();
}

// drag and drop events
private void window_mousemove ( Object sender, mouseeventargs e)
{< br> esimages. tsunseorcs (E);
}

//Don't forget the structure
Private VoidWindow_closing (ObjectSender, system. componentmodel. canceleventargs E)
{
Esimages. etimerstop ();
}

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.