WPF轮播图实现方式(二)

 WPF开发者QQ群: 340500857  | 微信群 -> 进入公众号主页 加入组织

欢迎转发、分享、点赞、在看,谢谢~。  

01

效果预览

02


代码如下

一、EmphasizerCarousel.cs 代码如下

using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Animation;
using WPFDevelopers.Controls.Helpers;namespace WPFDevelopers.Controls
{[DefaultProperty("Children")][ContentProperty("Children")][Localizability(LocalizationCategory.None, Readability = Readability.Unreadable)][TemplatePart(Name = Part_BackCanvasName, Type = typeof(Canvas))]public class EmphasizerCarousel : Control, IAddChild{static EmphasizerCarousel(){DefaultStyleKeyProperty.OverrideMetadata(typeof(EmphasizerCarousel), new FrameworkPropertyMetadata(typeof(EmphasizerCarousel)));}public EmphasizerCarousel(){Loaded += EmphasizerCarousel_Loaded;Unloaded += EmphasizerCarousel_Unloaded;SizeChanged += EmphasizerCarousel_SizeChanged;Children.CollectionChanged += OnItems_CollectionChanged;}[ReadOnly(true)]const string Part_BackCanvasName = "PART_BackCanvas";Canvas Part_BackCanvas = default;private const int _maxSimpleHeight = 320;private int _SimpleCount = 0;private FrameworkElement _DisplayItem = null;private double _SimpleTop = 0;private double _SimpleHeight = 0;private double _SimpleWidth = 0;//private double _SimpleOffset = 10;private double _DisplayHeight = 0;private double _DisplayWidth = 0;private double _DisplayOffset = 10d;private Dictionary<int, Point> _mapCanvasPoint = new Dictionary<int, Point>();private Dictionary<int, FrameworkElement> _mapUIwithIndex = new Dictionary<int, FrameworkElement>();private ObservableCollection<FrameworkElement> _Children = new ObservableCollection<FrameworkElement>();[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]public ObservableCollection<FrameworkElement> Children => _Children;private void OnItems_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e){if (e.Action == NotifyCollectionChangedAction.Add){foreach (var item in e.NewItems){if (item is FrameworkElement element){element.PreviewMouseLeftButtonDown += EmphasizerCarousel_MouseLeftButtonDown;element.RenderTransformOrigin = new Point(0.5, 0.5);element.RenderTransform = new TransformGroup{Children ={new ScaleTransform(),new SkewTransform(),new RotateTransform(),new TranslateTransform()}};}}}if (e.Action == NotifyCollectionChangedAction.Remove){foreach (var item in e.NewItems){if (item is FrameworkElement element)element.PreviewMouseLeftButtonDown -= EmphasizerCarousel_MouseLeftButtonDown;if (item == _DisplayItem)_DisplayItem = null;}}OnSizeChangedCallback();}#region overridepublic override void OnApplyTemplate(){base.OnApplyTemplate();Part_BackCanvas = GetTemplateChild(Part_BackCanvasName) as Canvas;if (Part_BackCanvas == null)throw new Exception("Some element is not in template!");}#endregionvoid IAddChild.AddChild(object value){throw new NotImplementedException();}void IAddChild.AddText(string text){throw new NotImplementedException();}private bool OnSizeChangedCallback(){if (Part_BackCanvas == null)return false;var vHeight = Part_BackCanvas.ActualHeight;var vWidth = Part_BackCanvas.ActualWidth;if (vHeight == Double.NaN || vWidth == Double.NaN)return false;if (vHeight == 0 || vWidth == 0)return false;Part_BackCanvas.Children.Clear();_mapUIwithIndex.Clear();_mapCanvasPoint.Clear();var vItemCount = Children.Count;if (vItemCount <= 0)return false;_SimpleCount = vItemCount - 1;if (_SimpleCount == 0){Children[0].Width = vWidth;Children[0].Height = vHeight;Part_BackCanvas.Children.Add(Children[0]);return true;}//计算并划分显示区域var vSimpleHeight = vHeight * 0.4;_SimpleHeight = vSimpleHeight;if (_SimpleHeight > _maxSimpleHeight)_SimpleHeight = _maxSimpleHeight;var vSimpleWidth = vWidth / _SimpleCount;_SimpleWidth = vSimpleWidth;_SimpleTop = vHeight - _SimpleHeight;_DisplayHeight = vHeight - _SimpleHeight;_DisplayHeight -= _DisplayOffset;_DisplayWidth = vWidth;if (_DisplayItem == null)_DisplayItem = Children[0];int nIndex = 0;int nPosIndex = 0;double Left = 0;foreach (var item in Children){Part_BackCanvas.Children.Add(item);item.Tag = nIndex;if (_DisplayItem == item){item.Width = _DisplayWidth;item.Height = _DisplayHeight;item.SetValue(Canvas.LeftProperty, 0d);item.SetValue(Canvas.TopProperty, 0d);}else{item.Width = _SimpleWidth;item.Height = _SimpleHeight;item.SetValue(Canvas.LeftProperty, Left);item.SetValue(Canvas.TopProperty, _SimpleTop);_mapCanvasPoint[nPosIndex] = new Point(Left, _SimpleTop);_mapUIwithIndex[nPosIndex] = item;Left += _SimpleWidth;++nPosIndex;}++nIndex;}return true;}private void EmphasizerCarousel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e){if (sender == _DisplayItem)return;e.Handled = true;var vFrameWorker = sender as FrameworkElement;if (vFrameWorker == null)return;if (!int.TryParse(_DisplayItem.Tag.ToString(), out int nIndex))return;if (!int.TryParse(vFrameWorker.Tag.ToString(), out int nLeaveIndex))return;int offset = 500;var vLeft = (_DisplayWidth - _SimpleWidth) / 2d;var vTop = (_DisplayHeight - _SimpleHeight) / 2d;//一系列计算 计算得到当前展示页要回到的Dock位置  //一系列计算 计算得到当前点击页要移除的Dock位置int nTargertIndex = nIndex;int nLeaveDockIndex = 0;foreach (var item in _mapUIwithIndex){if (!int.TryParse(item.Value.Tag.ToString(), out int nItemIndex))continue;if (nItemIndex == nLeaveIndex){nLeaveDockIndex = item.Key;_mapUIwithIndex[item.Key] = null;break;}}//如果目标位置Index是1那么他可以放在 0号位也可以放在1号位 主要是看他的前一个位置上的对象的Index是大还是小//判定 模拟演练 目标位置放入对象时 目标位置当前的对象时前移还是不动var vTargetFrame = _mapUIwithIndex.GetValueOrDefault(nTargertIndex);if (vTargetFrame != null){if (int.TryParse(vTargetFrame.Tag.ToString(), out int vTargetFrameIndex)){//先判定 后续动作是 左移还是右移bool? bLeft2Right = null;if (nTargertIndex > nLeaveDockIndex)bLeft2Right = false;else if (nTargertIndex < nLeaveDockIndex)bLeft2Right = true;if (bLeft2Right == true){if (vTargetFrameIndex < nIndex)nTargertIndex++;}if (bLeft2Right == false){if (vTargetFrameIndex > nIndex)nTargertIndex--;}}}if (nIndex >= _mapCanvasPoint.Count)nTargertIndex = _mapCanvasPoint.Count - 1;if (nIndex < 0)nTargertIndex = 0;Point point = _mapCanvasPoint.GetValueOrDefault(nTargertIndex);//定义动画 Storyboard storyboard = new Storyboard{SpeedRatio = 2,};int nBegin = 250;if (nTargertIndex < nLeaveDockIndex){//全部右移for (int i = nLeaveDockIndex - 1; i >= nTargertIndex; --i){var vUI = _mapUIwithIndex.GetValueOrDefault(i);if (vUI == null)continue;var vPoint = _mapCanvasPoint.GetValueOrDefault(i + 1);DoubleAnimation animation = new DoubleAnimation(){To = vPoint.X,BeginTime = TimeSpan.FromMilliseconds(nBegin),Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, vUI);Storyboard.SetTargetProperty(animation, new PropertyPath("(Canvas.Left)"));storyboard.Children.Add(animation);if (_mapUIwithIndex.ContainsKey(i + 1))_mapUIwithIndex[i + 1] = vUI;_mapUIwithIndex[i] = null;//nBegin += nBegin;}}else if (nTargertIndex > nLeaveDockIndex){//全部左移for (int i = nLeaveDockIndex + 1; i <= nTargertIndex; ++i){var vUI = _mapUIwithIndex.GetValueOrDefault(i);if (vUI == null)continue;var vPoint = _mapCanvasPoint.GetValueOrDefault(i - 1);DoubleAnimation animation = new DoubleAnimation(){To = vPoint.X,BeginTime = TimeSpan.FromMilliseconds(nBegin),Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, vUI);Storyboard.SetTargetProperty(animation, new PropertyPath("(Canvas.Left)"));storyboard.Children.Add(animation);if (_mapUIwithIndex.ContainsKey(i - 1))_mapUIwithIndex[i - 1] = vUI;_mapUIwithIndex[i] = null;//nBegin += nBegin;}}if (_mapUIwithIndex.ContainsKey(nTargertIndex))_mapUIwithIndex[nTargertIndex] = _DisplayItem;//当前打开的界面 先缩放 位移 后 移到等待区{DoubleAnimation animation = new DoubleAnimation(){To = _SimpleWidth,Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, _DisplayItem);Storyboard.SetTargetProperty(animation, new PropertyPath("Width"));storyboard.Children.Add(animation);}{DoubleAnimation animation = new DoubleAnimation(){To = _SimpleHeight,Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, _DisplayItem);Storyboard.SetTargetProperty(animation, new PropertyPath("Height"));storyboard.Children.Add(animation);}{DoubleAnimation animation = new DoubleAnimation(){To = vLeft,Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, _DisplayItem);Storyboard.SetTargetProperty(animation, new PropertyPath("(Canvas.Left)"));storyboard.Children.Add(animation);}{DoubleAnimation animation = new DoubleAnimation(){To = vTop,Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, _DisplayItem);Storyboard.SetTargetProperty(animation, new PropertyPath("(Canvas.Top)"));storyboard.Children.Add(animation);}{DoubleAnimation animation = new DoubleAnimation(){To = point.X,BeginTime = TimeSpan.FromMilliseconds(offset),Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, _DisplayItem);Storyboard.SetTargetProperty(animation, new PropertyPath("(Canvas.Left)"));storyboard.Children.Add(animation);}{DoubleAnimation animation = new DoubleAnimation(){To = point.Y,BeginTime = TimeSpan.FromMilliseconds(offset),Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, _DisplayItem);Storyboard.SetTargetProperty(animation, new PropertyPath("(Canvas.Top)"));storyboard.Children.Add(animation);}//当前选中的界面 移动到目标位置 再放大位移{DoubleAnimation animation = new DoubleAnimation(){To = vLeft,BeginTime = TimeSpan.FromMilliseconds(offset),Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, vFrameWorker);Storyboard.SetTargetProperty(animation, new PropertyPath("(Canvas.Left)"));storyboard.Children.Add(animation);}{DoubleAnimation animation = new DoubleAnimation(){To = vTop,BeginTime = TimeSpan.FromMilliseconds(offset),Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, vFrameWorker);Storyboard.SetTargetProperty(animation, new PropertyPath("(Canvas.Top)"));storyboard.Children.Add(animation);}{DoubleAnimation animation = new DoubleAnimation(){To = _DisplayWidth,BeginTime = TimeSpan.FromMilliseconds(offset * 2),Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, vFrameWorker);Storyboard.SetTargetProperty(animation, new PropertyPath("Width"));storyboard.Children.Add(animation);}{DoubleAnimation animation = new DoubleAnimation(){To = _DisplayHeight,BeginTime = TimeSpan.FromMilliseconds(offset * 2),Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, vFrameWorker);Storyboard.SetTargetProperty(animation, new PropertyPath("Height"));storyboard.Children.Add(animation);}{DoubleAnimation animation = new DoubleAnimation(){To = 0,BeginTime = TimeSpan.FromMilliseconds(offset * 2),Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, vFrameWorker);Storyboard.SetTargetProperty(animation, new PropertyPath("(Canvas.Top)"));storyboard.Children.Add(animation);}{DoubleAnimation animation = new DoubleAnimation(){To = 0,BeginTime = TimeSpan.FromMilliseconds(offset * 2),Duration = new Duration(new TimeSpan(0, 0, 0, 0, offset)),EasingFunction = new ExponentialEase { EasingMode = EasingMode.EaseOut },};Storyboard.SetTarget(animation, vFrameWorker);Storyboard.SetTargetProperty(animation, new PropertyPath("(Canvas.Left)"));storyboard.Children.Add(animation);}_DisplayItem = vFrameWorker;storyboard.Begin(vFrameWorker);}private void EmphasizerCarousel_Loaded(object sender, RoutedEventArgs e){}private void EmphasizerCarousel_Unloaded(object sender, RoutedEventArgs e){}private void EmphasizerCarousel_SizeChanged(object sender, SizeChangedEventArgs e) => OnSizeChangedCallback();}
}

二、EmphasizerCarousel.xaml 代码如下

<Style TargetType="{x:Type controls:EmphasizerCarousel}" BasedOn="{StaticResource ControlBasicStyle}"><Setter Property="Background" Value="Transparent"/><Setter Property="Template"><Setter.Value><ControlTemplate TargetType="{x:Type controls:EmphasizerCarousel}"><Grid Background="{TemplateBinding Background}" ><Canvas x:Name="PART_BackCanvas"></Canvas></Grid></ControlTemplate></Setter.Value></Setter>
</Style>

三、CarouselExampleEx.xaml 代码如下 

<UserControl x:Class="WPFDevelopers.Samples.ExampleViews.CarouselExampleEx"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:WPFDevelopers.Samples.ExampleViews"xmlns:wpfdev="https://github.com/yanjinhuagood/WPFDevelopers"mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"><Grid><wpfdev:EmphasizerCarousel><Image Source="pack://application:,,,/WPFDevelopers.Samples;component/Images/Craouse/0.jpg"/><Image Source="pack://application:,,,/WPFDevelopers.Samples;component/Images/Craouse/1.jpg"/><Image Source="pack://application:,,,/WPFDevelopers.Samples;component/Images/Craouse/2.jpg"/><Image Source="pack://application:,,,/WPFDevelopers.Samples;component/Images/Craouse/3.jpg"/><Image Source="pack://application:,,,/WPFDevelopers.Samples;component/Images/Craouse/4.jpg"/></wpfdev:EmphasizerCarousel></Grid>
</UserControl>

源码地址

github:https://github.com/yanjinhuagood/WPFDevelopers.git

gitee:https://gitee.com/yanjinhua/WPFDevelopers.git

WPF开发者QQ群: 340500857 

Github:https://github.com/yanjinhuagood

版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。

转载请著名作者 出处 https://github.com/yanjinhuagood

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/298212.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

实现链栈的各种基本运算的算法_LeetCode基础算法题第78篇:如何不用加减号实现两数的加法运算?...

一直很纠结算法的文章应该怎么写。最后觉得还是从最简单的level开始写吧&#xff0c;一开始就弄些重量级的&#xff0c;什么人工智能&#xff0c;机器学习的算法&#xff0c;还要有大量的数学以及优化的知识&#xff0c;小白们估计会很郁闷&#xff0c;当然我也不一定能做出来对…

Bootstrap在线编辑器简单分享

Bootstrap 已经使响应式网站开发变得简单很多。 但是如果你不必手动写全部代码&#xff0c;事情会如何呢&#xff1f; 如果你可以自由地选择你想要使用的Bootstrap 组件、并可以把它们拖拽到画布中&#xff0c;事情会如何呢&#xff1f;这就是Bootstrap 编辑器的用武之地。 在这…

爱因斯坦去世不到7个小时,大脑就被人偷走!还被切成240块,供变态医生把玩了几十年.........

全世界只有3.14 % 的人关注了爆炸吧知识你的智商说不定比爱因斯坦还高俗话说&#xff0c;人怕出名猪怕壮。作为世界闻名的大科学家&#xff0c;世人却更愿意把爱因斯坦的成就归功于“天赋异禀的脑子”&#xff0c;顺带着爱因斯坦其他的“身体零件”也都成了大家好奇的对象。爱因…

字符串池化,减少了三分之一的内存占用

字符串池化&#xff0c;减少重复实例&#xff0c;内存降低&#xff0c;一切就是这样的轻松愉快。开篇摘要 本文通过一个简单的业务场景&#xff0c;来描述如何通过字符串池化来减少内存中的重复字符串实例&#xff0c;从而减少内存的占用。在业务中&#xff0c;我们假设如下&am…

启动zookeeper_Giraph源码分析(一)—启动ZooKeeper服务

作者 | 白松Giraph介绍&#xff1a;Apache Giraph is an iterative graph processing system built for high scalability. For example, it is currently used at Facebook to analyze the social graph formed by users and their connections. Giraph originated as the ope…

【MFC】MFC中调用系统软键盘的几种方法

1.直接运行微软系统自带的虚拟键盘程序“osk.exe” 在普通MFC项目中可以调用ShellExecute或者WinExec方法来直接运行微软系统自带的虚拟键盘程序“osk.exe”&#xff0c;十分方便一句话就可以搞定。ShellExecute&#xff1a; ShellExecute(GetSafeHwnd(), NULL, _T("osk.e…

委派用户管理Hyper-v

在安装完成Hyper-v以后&#xff0c;默认情况下&#xff0c;只有管理员组的成员才有权限去管理Hyper-v&#xff0c;做一些诸如管理网络&#xff0c;管理虚拟机&#xff0c;管理磁盘等等的操作&#xff0c;普通用户没这个权限&#xff0c;从应用角度来说&#xff0c;如果公司所有…

这才是真正的蛙泳,还挺能蹦跶......

1 这才是真正的蛙泳▼2 给你们看看我平时藏起来的可爱▼3 沈腾这rap唱的跟闹着玩儿的似的▼4 能不能好好说话&#xff1f;▼5 建议再配套一张肛肠医院代金券▼6 这是我军培养出来的【特工鹅】吗&#xff1f;盯梢技能太强了▼7 钓鱼翻车现场▼你点的每个赞&#xff0c;我…

缓存机制 java_缓存机制:java中缓存的原理

外存&#xff1a;也就是我们经常说的(CDEF盘的大小)外储存器是指除计算机内存及CPU缓存以外的储存器&#xff0c;此类储存器一般断电后仍然能保存数据。常见的外存储器有硬盘、软盘、光盘、U盘等&#xff0c;一般的软件都是安装在外存中内存&#xff1a;内存是计算机中重要的部…

docker-compose 一键部署分布式配置中心Apollo

简介说起分布式肯定要想到分布式配置中心、分布式日志、分布式链路追踪等在分布式部署中业务往往有很多配置比如: 应用程序在启动和运行时需要读取一些配置信息&#xff0c;配置基本上伴随着应用程序的整个生命周期&#xff0c;比如&#xff1a;数据库连接参数、启动参数等,都需…

Sharepoint Designer 2007 Workflow

参考 http://office.microsoft.com/en-us/sharepoint-designer-help/collect-data-from-a-user-in-a-workflow-HA010209808.aspx 注意 这里的Review Document是一个Task List, 应该在site里面创建一个task list&#xff0c;可以用默认的Tasks.转载于:https://www.cnblogs.com/F…

uva705--slash maze

/*这道题我原本是将斜线迷宫扩大为原来的两倍&#xff0c;但是在这种情况下对于在斜的方向上的搜索会变的较容易出错&#xff0c;所以参考了别人的思路后将迷宫扩展为原来的3倍&#xff0c;这样就变成一般的迷宫问题了*/ 1 #include"iostream"2 #include"stdio.…

重磅公开!集14位名师教案的《最全高中数学解题思想方法汇编》

全世界只有3.14 % 的人关注了爆炸吧知识解数学题&#xff0c;除了掌握有关的数学知识之外&#xff0c;最好掌握一定的解题技巧甚至知道点解题思想。要知道高考试题的解答过程中蕴含着重要的数学思想方法&#xff0c;如果能有意识地在解题过程中加以运用&#xff0c;势必会取得很…

极域课堂管理系统软件如何取消控制_智慧物流自动化智能仓储管理架构分析

现阶段&#xff0c;智慧物流&#xff08;ztmapinfo.com.&#xff09;成为了时事热点&#xff0c;获得物流界广泛关注。许多 物流自动化系统、物流自动化设备都打出了智慧物流的幌子&#xff0c;在刚结束了的CeMAT亚洲物流展上&#xff0c;宣传展现智慧物流技术与商品的公司增加…

控制 Redis stream 的消息数量

控制 Redis stream 的消息数量IntroRedis Stream 是 Redis 5.0 引入的一个新的类型&#xff0c;之前我们介绍过使用 Redis Stream 来实现消息队列&#xff0c;可以参考之前的文章 使用 Redis Stream 实现消息队列&#xff0c;而 Stream 的消息会持久化地内存中&#xff0c;如果…

startindex 不能大于字符串长度_玩转云端丨redis的5种对象与8种数据结构之字符串对象(下)...

引言本文是对《redis设计与实现(第二版)》中数据结构与对象相关内容的整理与说明。本篇文章只对对象结构&#xff0c;1种对象——字符串对象。以及字符串对象所对应的两种编码——raw和embstr&#xff0c;进行了详细介绍。表达一些本人的想法与看法&#xff0c;也希望更多朋友一…

网友半夜差点被沐浴露吓死,众人:原来不止我胆小....

全世界只有3.14 % 的人关注了爆炸吧知识微博上有网友爆料说&#xff0c;他半夜上厕所差点被沐浴露吓死&#xff01;这么看可能不明显但是关灯的时候.....啊啊啊啊啊&#xff5e;结果引来众多网友的共鸣&#xff0c;原来大家都有类似遭遇....比如&#xff0c;你有被饮水机吓到过…

.NET 6 RC1 正式发布

昨天晚上微软发布了.NET 6的两个RC版本中的第一个版本&#xff0c;该版本将于11月正式发布&#xff0c;作为在开源MIT协议下整合所有不同的.NET开发模组件的开源跨平台实现。这是一个从2014年开始&#xff0c;持续多年的&#xff0c;以改变应用开发游戏规则的努力&#xff0c;由…

Winform开发中另一种样式的OutLookBar工具条

很早的时候&#xff0c;曾经写了一篇随笔《WinForm界面开发之“OutLookBar”工具条》介绍了OutLookBar样式的工具条&#xff0c;得到很多同行的热烈反馈&#xff0c;我个人也比较喜欢这样的工具条布局&#xff0c;因此我很多共享软件中&#xff0c;都经常看到这种OutLookBar的工…

r语言主成分分析_PCA主成分分析

PCA主成分分析最近遇到了主成分分析法这个东西&#xff0c;一开始我觉得简直天才啊&#xff0c;这个想法虽然从经济意义上来解释有点奇怪&#xff0c;毕竟是数学方法计算出来的解释因子&#xff0c;但鉴于没人知道现实世界究竟被多少因素影响&#xff0c;这种方法可以将最主要的…