Windows界面编程第十二篇 位图显示特效 飞入效果与伸展效果

html+css制作盾牌飞入效果 html+css 制作盾牌飞入效果 阅读详情

转载请标明出处,原文地址:http://blog.youkuaiyun.com/morewindows/article/details/8696726

欢迎关注微博:http://weibo.com/MoreWindows

 Windows界面编程之位图显示特效系列目录:

1. 《Windows界面编程第九篇位图显示特效交错效果》

http://blog.youkuaiyun.com/morewindows/article/details/8696720

2. 《Windows界面编程第十篇位图显示特效百叶窗效果》

http://blog.youkuaiyun.com/morewindows/article/details/8696722

3. 《Windows界面编程第十一篇位图显示特效随机积木效果》

http://blog.youkuaiyun.com/morewindows/article/details/8696724

4. 《Windows界面编程第十二篇位图显示特效飞入效果与伸展效果》

http://blog.youkuaiyun.com/morewindows/article/details/8696726

5. 《Windows界面编程第十三篇位图显示特效合集》

http://blog.youkuaiyun.com/morewindows/article/details/8696730

 

    本篇《Windows界面编程第十二篇位图显示特效飞入效果与伸展效果》将讲解位图的飞入效果与伸展效果。飞入效果与伸展效果非常常见,在《Windows界面编程第六篇动画启动效果(动画效果显示及隐藏窗口)》(http://blog.youkuaiyun.com/morewindows/article/details/8656068)可以体验程序窗口在启动和退出的飞入动画效果与伸展动画效果。

       从上往下的伸展效果(图片不能打开,请访问http://blog.youkuaiyun.com/morewindows/article/details/8696726)

       从下往上的伸展效果(图片不能打开,请访问http://blog.youkuaiyun.com/morewindows/article/details/8696726)

       从左往右的飞入效果(图片不能打开,请访问http://blog.youkuaiyun.com/morewindows/article/details/8696726)

       从右往左的飞入效果(图片不能打开,请访问http://blog.youkuaiyun.com/morewindows/article/details/8696726)

       在程序设计上,只要计算好显示坐标就可以了,直接给出代码:

// 飞入与伸展 - 从上往下
//《Windows界面编程第十二篇 位图显示特效 飞入效果与伸展效果》
//http://blog.youkuaiyun.com/morewindows/article/details/8696726
void AnimateDraw_FlyingTopToBottom(HDC hdc, HDC hdcMem, int nWidth, int nHeight, UINT nIntervalTime = 2, BOOL bFade = TRUE)
{
	int j;
	if (bFade)
	{
		for (j = 0; j <= nHeight; j++)
		{
			BitBlt(hdc, 0, 0, nWidth, j, hdcMem, 0, 0, SRCCOPY); 
			Sleep(nIntervalTime);
		}
	}
	else
	{
		for (j = 0; j <= nHeight; j++)
		{
			BitBlt(hdc, 0, 0, nWidth, j, hdcMem, 0, nHeight - j, SRCCOPY); 
			Sleep(nIntervalTime);
		}
	}
	BitBlt(hdc, 0, 0, nWidth, nHeight, hdcMem, 0, 0, SRCCOPY);
}

// 飞入与伸展 - 从下往上
//《Windows界面编程第十二篇 位图显示特效 飞入效果与伸展效果》
//http://blog.youkuaiyun.com/morewindows/article/details/8696726
void AnimateDraw_FlyingBottomToTop(HDC hdc, HDC hdcMem, int nWidth, int nHeight, UINT nIntervalTime = 2, BOOL bFade = TRUE)
{
	int j;
	if (bFade)
	{
		for (j = nHeight; j >= 0; j--)
		{
			BitBlt(hdc, 0, j, nWidth, nHeight - j, hdcMem, 0, j, SRCCOPY); 
			Sleep(nIntervalTime);
		}
	}
	else
	{
		for (j = nHeight; j >= 0; j--)
		{
			BitBlt(hdc, 0, j, nWidth, nHeight - j, hdcMem, 0, 0, SRCCOPY); 
			Sleep(nIntervalTime);
		}
	}
	BitBlt(hdc, 0, 0, nWidth, nHeight, hdcMem, 0, 0, SRCCOPY);
}

// 飞入与伸展 - 从左往右
//《Windows界面编程第十二篇 位图显示特效 飞入效果与伸展效果》
//http://blog.youkuaiyun.com/morewindows/article/details/8696726
void AnimateDraw_FlyingLeftToRight(HDC hdc, HDC hdcMem, int nWidth, int nHeight, UINT nIntervalTime = 2, BOOL bFade = TRUE)
{
	int i;
	if (bFade)
	{
		for (i = 0; i <= nWidth; i++)
		{
			BitBlt(hdc, 0, 0, i, nHeight, hdcMem, 0, 0, SRCCOPY); 
			Sleep(nIntervalTime);
		}
	}
	else
	{
		for (i = 0; i <= nWidth; i++)
		{
			BitBlt(hdc, 0, 0, i, nHeight, hdcMem, nWidth - i, 0, SRCCOPY); 
			Sleep(nIntervalTime);
		}
	}
	BitBlt(hdc, 0, 0, nWidth, nHeight, hdcMem, 0, 0, SRCCOPY);
}

// 飞入与伸展 - 从右往左
//《Windows界面编程第十二篇 位图显示特效 飞入效果与伸展效果》
//http://blog.youkuaiyun.com/morewindows/article/details/8696726
void AnimateDraw_FlyingRightToLeft(HDC hdc, HDC hdcMem, int nWidth, int nHeight, UINT nIntervalTime = 2, BOOL bFade = TRUE)
{
	int i;
	if (bFade)
	{
		for (i = nWidth; i >= 0; i--)
		{
			BitBlt(hdc, i, 0, nWidth - i, nHeight, hdcMem, i, 0, SRCCOPY); 
			Sleep(nIntervalTime);
		}
	}
	else
	{
		for (i = nWidth; i >= 0; i--)
		{
			BitBlt(hdc, i, 0, nWidth - i, nHeight, hdcMem, 0, 0, SRCCOPY); 
			Sleep(nIntervalTime);
		}
	}
	BitBlt(hdc, 0, 0, nWidth, nHeight, hdcMem, 0, 0, SRCCOPY);
}

完整的程序在《Windows界面编程第十三篇位图显示特效合集》

http://blog.youkuaiyun.com/morewindows/article/details/8696730

转载请标明出处,原文地址:http://blog.youkuaiyun.com/morewindows/article/details/8696726

欢迎关注微博:http://weibo.com/MoreWindows


 

图像特效显示 扫描 移动 交叉飞入 百叶窗特效 马赛克显示 栅条显示 图像渐显 中间扩张 中间收缩 标记.rar 图像特效显示VS2017编译通过,可直接运行 包括扫描 移动 交叉飞入 百叶窗特效 马赛克显示 栅条显示 图像渐显 中间扩张 中间收缩 标记 立即下载

相关推荐

基于Arduino的智能垃圾桶

通过本次简单的Arduino智能垃圾桶小实验可以快速了解Arduino的基本用法 1、材料准备 Arduino UNO HC-SR04超声波模块 SG90舵机 杜邦线 电源 电脑 2、代码分析 电机的控制 #include<Servo.h> #define duoji D5 Servo myduoji; void setup() { myduoji.attach(duoji); //舵机连接 Serial.begin(115200); } void loop() { myduoji.w

weixin_41679960的博客 1万+

【转】C#窗体飞入飞出的动画效果(Api)

1 [System.Runtime.InteropServices.DllImport("user32")] 2 private static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags); 3 //* 函数功能:该函数能在显示与隐藏窗口时能产生...

allthebest1666的博客 439

新手必看:四旋翼无人机PID调参实战指南(附常见问题排查)

本文为四旋翼无人机新手提供PID调参实战指南,详细解析Kp、Ki、Kd参数的实际意义及调参技巧,包含常见问题排查方法。通过系统化的调参流程和实用参考表,帮助用户快速掌握无人机飞行控制核心技能,避免常见错误,提升飞行稳定性与响应性能。

k0l1m2n3o的博客 599

jQuery图片墙飞来动画3djs特效

一款炫酷的jQuery图片墙网页特效,飞来动画3d效果,从远到近的动效。

ICode联盟 440

OpenEuler内核编译及替换

一、内核源码下载 在gitee上下载OpenEuler内核源码 下载地址 选择需要的内核版本源码压缩包进行下载 二、内核编译 1.解压缩 将下载好的源码进行解压 tar xvf openeuler-kernel-4.19.90-2107.1.0.tar.gz 2.清理源代码树 解压后得到一个名为kernel的内核源码文件夹,进入后执行命令 make mrproper 清理过去内核编译产生的config,第一次编译时可不执行此命令 3.生成内核配置文件.config 先将将系统原配置文件拷贝过来,原

m0_56602092的博客 2万+

嵌入式工程师必学(52):储能系统ESS

能量存储系统(ESS,Energystoragesystems)存在于各种各样的尺寸、形状和技术中。储能系统的技术,即基本的储能机制,自然会影响其重要特性,包括成本、安全性、性能、可靠性和寿命。然而,尽管基础技术很重要,但一个成功的储能项目依赖于对该技术的彻底和深思熟虑的实施,以实现项目的目标。成功的实施取决于储能系统的架构和组装情况。系统的体系结构可以决定其性能和可靠性,与它所使用的技术一致,甚至与之无关。

码农17年的博客 1443

html星星连线特效代码,js实现飞入星星特效代码

本文实例讲述了js实现飞入星星特效代码,分享给大家供大家参考。具体实现代码如下:代码如下:星空极速飞入效果xL=8;xH=xW=xR=xE=xMY=xMX=xWd=xHd=0;xF=new Array();xY=new Array();xX=new Array();xS=new Array();xA=new Array();xB=new Array();ini=new Array();docume...

weixin_39789327的博客 598

【如何利用扩展卡尔曼滤波解决跟踪毫米波雷达目标】

笛卡尔坐标系(非极坐标系):使用两个垂直的轴(通常是x轴和y轴)来确定一个点的位置。你沿着这两个轴移动确定的距离来找到这个点。极坐标系:使用一个角度和一个距离来确定一个点的位置。首先,你转到一个特定的方向(角度),然后沿着那个方向移动确定的距离来找到这个点。希望这个例子能帮助你理解两种坐标系的基本概念!

小秋 AI SLAM 入门实战教程 884

Windows界面编程第十三篇 位图显示特效合集

Windows界面编程第十三篇 位图显示特效合集

ffygvf的博客 128

【ESP32设备通信】-LoRaWAN网关

在物联网 (IoT) 时代,连接设备和收集数据变得比以往任何时候都更加容易和重要。 LoRaWAN(远程广域网)技术已成为远程、低功耗物联网通信的强大解决方案。 在本教程中,我们将使用 ESp32 构建 LoRaWAN 网关电路,并使用 ESP32 和 BME280 传感器构建传感器节点电路。 对于这两个电路,我们将使用基于 SX1278 (Ra-02) LoRa 模块在设备之间进行无线通信。 我们还将向您展示如何将传感器数据传输到流行的物联网平台 ThingSpeak。

视觉与物联智能 1582

全球建筑物提取数据集(免费下载):微软/GlobalMLBuildingFootprints

这个是GitHub上的开源数据集: https://github.com/microsoft/GlobalMLBuildingFootprints 介绍 必应地图正在世界各地发布开放式建筑足迹。我们从 2014 年到 2021 年间的 Bing Maps 图像中检测到了 7.77 亿座建筑物,包括 Maxar 和 Airbus 的图像。数据可在 ODbL 下免费下载和使用。该数据集补充了我们的其他版本。 包括的地区 执照 此数据由 Microsoft 根据Open Dat..

此星光明博客 6289

Windows界面编程第十一篇 位图显示特效 随机积木效果

Windows界面编程第十一篇 位图显示特效 随机积木效果

ffygvf的博客 244

UNet改进(47):Deformable Convolution在UNet中的集成与应用

本文提出了一种可变形U-Net(DeformableUNet)结构,通过在U-Net的双卷积模块中集成可变形卷积(DeformConv2d)来提升模型对物体形变和复杂结构的建模能力。传统卷积受限于固定感受野,而可变形卷积通过动态调整采样位置,能更好地适应不规则形状。实现中,在DoubleConv模块的第二个卷积层替换为可变形卷积,同时保持第一层为标准卷积以确保稳定性。实验表明,该方法在保持参数量基本不变的情况下,显著提升了分割精度(mIoU从0.712提升到0.743)。

2501_91516851的博客 201

Windows界面编程第九篇 位图显示特效 交错效果

Windows界面编程第九篇 位图显示特效 交错效果

ffygvf的博客 206

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

Windows界面编程第十篇 位图显示特效 百叶窗效果

Windows界面编程第十篇 位图显示特效 百叶窗效果

ffygvf的博客 180

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: Windows界面编程第十一篇 位图显示特效 随机积木效果
下一篇: Windows界面编程第十三篇 位图显示特效合集
MoreWindows
MoreWindows 《白话经典算法》、《秒杀多线程》作者 《白话经典算法》、《秒杀多线程》作者 领域专家: 操作系统技术领域 领域专家: 操作系统技术领域
博客等级 码龄15年 2万+粉丝 157原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值