资源简介
wpf 自定义控件

代码片段和文件信息
//source( Microsoft All-In-One Code framework ):http://1code.codeplex.com/
using System;
using System.Drawing;
using System.IO;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Threading;
using File = System.Utility.Helper.File;
using Image = System.Windows.Controls.Image;
namespace Util.Controls
{
///
/// 支持GIF动画图片播放的图片控件,GIF图片源GIFSource
///
public class AnimatedGIF : Image
{
public static readonly DependencyProperty GIFSourceProperty = DependencyProperty.Register(
“GIFSource“ typeof(string) typeof(AnimatedGIF) new Propertymetadata(OnSourcePropertyChanged));
///
/// GIF图片源,支持相对路径、绝对路径
///
public string GIFSource
{
get { return (string)GetValue(GIFSourceProperty); }
set { SetValue(GIFSourceProperty value); }
}
internal Bitmap Bitmap; // Local bitmap member to cache image resource
internal BitmapSource BitmapSource;
public delegate void frameUpdatedEventHandler();
///
/// Delete local bitmap resource
/// Reference: http://msdn.microsoft.com/en-us/library/dd183539(VS.85).aspx
///
[DllImport(“gdi32.dll“ CharSet = CharSet.Auto SetLastError = true)]
static extern bool Deleteobject(IntPtr hobject);
protected override void OnInitialized(EventArgs e)
{
base.OnInitialized(e);
this.Loaded += AnimatedGIF_Loaded;
this.Unloaded += AnimatedGIF_Unloaded;
}
void AnimatedGIF_Unloaded(object sender RoutedEventArgs e)
{
this.StopAnimate();
}
void AnimatedGIF_Loaded(object sender RoutedEventArgs e)
{
BindSource(this);
}
///
/// Start animation
///
public void StartAnimate()
{
ImageAnimator.Animate(Bitmap OnframeChanged);
}
///
/// Stop animation
///
public void StopAnimate()
{
ImageAnimator.StopAnimate(Bitmap OnframeChanged);
}
///
/// Event handler for the frame changed
///
private void OnframeChanged(object sender EventArgs e)
{
Dispatcher.BeginInvoke(DispatcherPriority.Normal
new frameUpdatedEventHandler(frameUpdatedCallback));
}
private void frameUpdatedCallback()
{
ImageAnimator.Updateframes();
if (BitmapSource != null)
BitmapSource.Freeze();
// Convert the bitmap to BitmapSource that can be display in WPF Visua
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-04-16 22:24 Util.Controls\
目录 0 2016-04-16 22:43 Util.Controls\Util.Controls\
目录 0 2016-04-16 22:18 Util.Controls\Util.Controls\Control\
文件 4737 2016-04-16 22:18 Util.Controls\Util.Controls\Control\AnimatedGIF.cs
文件 5153 2016-04-16 22:18 Util.Controls\Util.Controls\Control\BulletCheckBox.xaml
文件 2366 2016-04-16 22:18 Util.Controls\Util.Controls\Control\BulletCheckBox.xaml.cs
文件 3315 2016-04-16 22:18 Util.Controls\Util.Controls\Control\BusyBox.xaml
文件 814 2016-04-16 22:18 Util.Controls\Util.Controls\Control\BusyBox.xaml.cs
文件 9956 2016-04-16 22:18 Util.Controls\Util.Controls\Control\FButton.xaml
文件 5609 2016-04-16 22:18 Util.Controls\Util.Controls\Control\FButton.xaml.cs
文件 1427 2016-04-16 22:18 Util.Controls\Util.Controls\Control\FImage.xaml
文件 2955 2016-04-16 22:18 Util.Controls\Util.Controls\Control\FImage.xaml.cs
文件 745 2016-04-16 22:18 Util.Controls\Util.Controls\Control\HighTextBlock.xaml
文件 3857 2016-04-16 22:18 Util.Controls\Util.Controls\Control\HighTextBlock.xaml.cs
文件 2498 2016-04-16 22:18 Util.Controls\Util.Controls\Control\MessageBoxX.xaml
文件 4537 2016-04-16 22:18 Util.Controls\Util.Controls\Control\MessageBoxX.xaml.cs
文件 15826 2016-04-16 22:18 Util.Controls\Util.Controls\Control\MultiComboBox.xaml
文件 2285 2016-04-16 22:18 Util.Controls\Util.Controls\Control\MultiComboBox.xaml.cs
文件 9052 2016-04-16 22:18 Util.Controls\Util.Controls\Control\ProgressRing.cs
文件 21339 2016-04-16 22:18 Util.Controls\Util.Controls\Control\ProgressRing.xaml
目录 0 2016-04-16 22:43 Util.Controls\Util.Controls\Control\ThumbnailImage\
文件 252 2016-04-16 22:18 Util.Controls\Util.Controls\Control\ThumbnailImage\EnumThumbnail.cs
文件 435 2016-04-16 22:18 Util.Controls\Util.Controls\Control\ThumbnailImage\IThumbnailProvider.cs
文件 822 2016-04-16 22:18 Util.Controls\Util.Controls\Control\ThumbnailImage\ImageThumbnailProvider.cs
文件 6701 2016-04-16 22:43 Util.Controls\Util.Controls\Control\ThumbnailImage\ThumbnailImage.cs
文件 890 2016-04-16 22:18 Util.Controls\Util.Controls\Control\ThumbnailImage\ThumbnailProviderFactory.cs
文件 1158 2016-04-16 22:18 Util.Controls\Util.Controls\Control\ThumbnailImage\VedioThumbnailProvider.cs
文件 1082 2016-04-16 22:18 Util.Controls\Util.Controls\Control\ThumbnailImage\WebImageThumbnailProvider.cs
文件 30493 2016-04-16 22:18 Util.Controls\Util.Controls\Control\VirtualizingWrapPanel.cs
文件 1727 2015-12-22 15:49 Util.Controls\Util.Controls\Control\WaitingBox.xaml
文件 1698 2015-12-22 15:49 Util.Controls\Util.Controls\Control\WaitingBox.xaml.cs
............此处省略516个文件信息
- 上一篇:asp.net 操作百度地图
- 下一篇:C# Winform仿360窗口菜单界面程序
相关资源
- C#自定义控件
- 用WPF开发的多人聊天室 语言C#
- 一个很强大的C#第三方控件!!(附带
- WPF控件库HandyControl
- WPF
- c# wpf实现的上位机
- VisionPro控件在WPF 应用
- winform下拉多选自定义控件(带全选)
- WPF使用MVVM
- winform实现饼状图、柱状图、折线图(
- C#中WPF联合Halcon的一个学习(解决内存
- WPF CEFSHARP 支持 MP4
- WPF贝塞尔曲线
- WPF 简单控件集
- WPF鼠标拖动控件源码
- wpf开发教程
- AduMusic迷你音乐盒WPF源码
- WPF PDF封装(放大、缩小、单页、双页
- C# .NET5.0(net core)基于WPF(XAML)开发
- WPF MVVM 基础入门
- wpf echart
- windorm 加载WPF控件 ,实现dxf文件显示
- WPF Control Development
- wpf Dock window
- WPF 隐蔽查看股票行情工具
- WPF控件库(HandyControl)
- 别踩白块wpf 源码
- WPF贪吃蛇
- WPF Task 多任务
- WPF path动画
评论
共有 条评论