坑爹的startDrag、stopDrag

Qt Drag&Drop拖动与放置 本文章从属于系列拖放操作包括两个动作:拖动(drag)和放下(drop或称为放置)。 阅读详情

startDrag、stopDrag有个很蛋碎的地方,浪费了我一早上。蛋疼的地方如一下代码:

package

{
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.MouseEvent;
import flash.geom.Rectangle;

public class testDrag extends Sprite
{
private var bg:Sprite=new Sprite();
private var bg1:Sprite=new Sprite();
public function testDrag()
{
stage.scaleMode=StageScaleMode.NO_SCALE;
stage.align=StageAlign.TOP_LEFT;
bg.graphics.beginFill(0xcccccc,0.5);
bg.graphics.drawRoundRect(10,10,50,50,8,8);
bg.graphics.endFill();
addChild(bg);
bg.addEventListener(MouseEvent.MOUSE_DOWN,dowmHander);
bg.addEventListener(MouseEvent.MOUSE_UP,upHander);

bg1.graphics.beginFill(0xff0000,0.5);
bg1.graphics.drawRoundRect(100,100,50,50,8,8);
bg1.graphics.endFill();
addChild(bg1);
stage.addEventListener(MouseEvent.MOUSE_DOWN,stagupHander)
}

protected function stagupHander(event:MouseEvent):void
{
bg1.stopDrag();
}

protected function upHander(event:MouseEvent):void
{
bg.stopDrag();
}

protected function dowmHander(event:MouseEvent):void
{
bg.startDrag(false,new Rectangle(10,10,100,50));
}

}

}


这样的bg是拖动不了的,因为有一个bg1停止拖动了,所以导致全部都停止了。骂人


CODESYS无扰切换PID(ST源代码) /运行信号//手自动切换//设置值、目标值yk : REAL;// 实际值、反馈信号;// 开环给定值;// 比例增益;// 积分时间 单位S;Td : REAL;// 微分时间 单位S;//采样时间 单位S// 滤波时间 单位S;//中断周期 默认10msEND_VARVAR_OUTPUT//uk : REAL;//控制器输出;//上一时刻的实际值;uDk : REAL; 阅读详情

相关推荐

Innovus 安装全过程

【代码】Innovus 安装全过程。

lmyynlbcy的博客 5535

startDrag

startDrag 可用性 Flash Player 4。 用法 startDrag(target,[lock ,left , top , right, bottom]) 参数 target 要拖动的影片剪辑的目标路径。 lock 一个布尔值,指定可拖动影片剪辑是锁定到鼠标位置中央 (true),还是锁定到用户首次点击该影片剪辑的位置上 (false)。此参数是可选的

xrosss的专栏 1001

unity中简单全景搭建

全景场景能够直观的展现一部分区域的全貌,在全景场景中我们能360°观看周围的景象,仿佛自身就在这个场景中,在场景的外部,我们能发现场景就是一个密封的球体,我们是处在球体的内部观察周围,在球内部观察四周看到的都是球的内表面,所以我们看到的全景其实就是贴在密封球体内的一张全景图片。接下来要介绍的就是如何在unity中用一个球体来搭建全景场景。

qq_31791999的博客 3637

Android - 拖放

Android 拖放框架允许您的用户使用图形拖放手势将数据从一个视图移动到当前布局中的另一个视图。从API 11开始,支持将视图拖放到其他视图或视图组上。该框架包括以下三个重要组件以支持拖放 & 丢弃功能 −拖动事件类。拖动监听器。辅助方法和类。拖放过程拖放过程基本上有四个步骤或状态 −Started− 当您...

小屁孩大帅-保密的博客 1474

半导体关键系统之RMS浅谈

这种系统还要求设备在设备上的配方发生变化时通知工厂主机,并需要与EAP(Equipment Automation Process)联结,旨在实时管控自动化系统所用配方与用户当初的设定是否匹配,从而使得自动化系统所用的配方更加趋于安全。例如,制药行业中的药品生产管理系统(GMP),它对药品的生产过程进行严格控制,包括原材料的采购、生产工艺流程、质量控制等方面。这些系统通常与企业的生产系统集成,能够对产品的配方进行精细化管理,包括配方的设计、试验、验证、生产等环节。

阿拉伯梳子的专栏 6155

自绘CListCtrl时发现ON_WM_MEASUREITEM_REFLECT和DrawItem(LPDRAWITEMSTRUCT lpMeasureItemStruct) 无响应

自绘CListCtrl时发现ON_WM_MEASUREITEM_REFLECT和DrawItem(LPDRAWITEMSTRUCT lpMeasureItemStruct) 无响应 一般情况下,我们都是在 dialog 里面 放一个 list 控件,然后 用自己的类绑定自己的自绘对象,如同下面: 1.  在 dialog 里面 加一个 list 列表 2. 然后 绑定这个列表 哈哈...

mfreesky的专栏 2170

Qt-拖放

是世界上几乎所有语言的文本编码标准。现在,在大多数现代操作系统上,它被用作文本的本地编码。主要的例外是Microsoft Windows,它仍然有一个双重系统,支持代码页和应用程序的Unicode。

qq_32640443的博客 1353

RK3588嵌入式开发:从零构建Rockit多媒体处理引擎的实战指南

本文详细介绍了如何在RK3588嵌入式平台上从零构建Rockit多媒体处理引擎的实战指南。涵盖开发环境搭建、工具链配置、源码编译流程、硬件加速优化及典型问题解决方案,帮助开发者高效利用RK3588的NPU和VPU加速特性,实现高性能多媒体处理应用。

mango的博客 186

vue-draggable-resizable 拖拽缩放插件

安装: npm install --save vue-draggable-resizable 第一种:基本使用: <template> <div style="height: 500px; width: 500px; border: 1px solid red; position: relative;"> <vue-draggable-resizable :w="100" :h="100" v-on:dragging="onDrag" v-on:resizing="

c_qianxia5040的博客 1835

神经网络:初学者指南(专业版)

神经网络是一种受生物大脑启发的计算模型,由多层互连的人工神经元组成。本文从生物神经元结构出发,介绍了感知器模型、激活函数、网络架构(输入/隐藏/输出层)等基础概念,并详细阐述了前向传播、反向传播、损失函数和优化器等核心训练机制。同时涵盖了CNN、RNN等常见架构,以及过拟合、梯度消失等关键挑战,最后概述了神经网络在计算机视觉、NLP等领域的广泛应用。全文系统性地梳理了神经网络的基础理论和实践要点,为初学者提供了清晰的学习路径。

weixin_42107409的博客 1782

关于使用CMT2300A FIFO缓存区间设置为64Byte的问题

帮助你解决在使用CMT2300A 时遇到的各种问题,若有需要,请及时与我交流

teleger的博客 1428

FLASH AS3.0 鼠标拖动技术 startDrag();stopDrag();

mc:MovieClip   mc添加两个鼠标事件:鼠标按下时 可以拖动;鼠标松开 停止拖动; mc.addEventListener(MouseEvent.MOUSE_DOWN,onMouseDownHandler); mc.addEventListener(MouseEvent.MOUSE_UP,onMouseUpHandler);   private fu

wangmj518的专栏 9233

YOLOv12改进策略【模型轻量化】| 替换骨干网络 CVPR-2024 StarNet,超级精简高效的轻量化模块

本文记录的是基于StarNet的YOLOv12轻量化改进方法研究。StarNet设计简洁,没有复杂的设计和精细调整的超参数,仅是一个 4 阶段的分层架构。并且其中能够在低维空间计算的同时考虑极高维的特征这一特性,进而提高模型精度。本文在替换骨干网络中配置了原论文中的starnet_s1starnet_s2starnet_s3和starnet_s4七种模型,以满足不同的需求。

Limiiiing的博客 1215

vue-drag-resize点击事件和拖拽事件冲突

vue-drag-resize组件的使用,以及点击事件和拖拽事件冲突解决办法

weixin_44278376的博客 1598

深度学习工具包 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")

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

jquery.ui.draggable中文文档

[原文翻译] JQuery UI Draggable插件用来使选中的元素可以通过鼠标拖动. Draggable的元素受影响css: ui-draggable, 拖动过程中的css: ui-draggable-dragging. 如果需要的不仅仅是拖, 而是一个完整的拖放功能, 请参阅JQuery UI 的Droppable插件, 该插件提供了一个draggable放的目标. 所有的回调函数

teresa502的专栏 1391

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

【AS3代码】小球拖拽(MouseEvent的方式 和 startDrag的方式)

package{importcom.ui.Ball;importcom.ui.Ship;importflash.display.Sprite;importflash.events.MouseEvent;publicclassMainextendsSprite{privatevarball:Ball;...

weixin_30294709的博客 221

QT拖拽功能简介

Drag和Drop是两个完全不同的动作。Qt中的控件可以作为拖动(drag)的地点,也可以作为松开(drop)的地点,或者同时作为拖动和松开的地点。第一个例子用来说明一个Qt应用程序接受另一个程序触发的拖动事件。该Qt应用程序是一个QTextEdit为中央控件的主窗口。当用户从桌面或者一个文件浏览器中拖动一个文本文件到Qt程序时松开,程序把文件显示在QTextEdit控件中。下面是主窗口的定义class MainWindow : public QMainWindow{    Q_OBJECTpublic: 

pcsuite的专栏 3万+

自定义指令 禁止拖动+鼠标样式为默认箭头样式

import Vue from 'vue'; const stopDrag = Vue.directive('stopDrag', { inserted: function (el, binding, vnode) { el.style.cursor = 'default' let element = el; element.onmousedown = function (e) { e.stopPropagation()

josiecici的博客 361

vue如何拖动改变组件大小_Vue组件,用于可拖动和可调整大小的元素

vue如何拖动改变组件大小 Vue拖动调整大小 (Vue-drag-resize) Vue Component for resize and drag elements. Vue组件,用于调整大小和拖动元素。 View demo 查看演示 Download Source 下载源 特征 (Features) A lightweight, no-dependency 轻巧,无依赖 Us...

cuk5239的博客 8454

不用startDrag和stopDrag的对象拖动

package { import flash.display.Sprite; import flash.events.MouseEvent; import flash.ui.MouseCursor; import flash.ui.Mouse; public class MouseMoveDrag extends Sprite { p

Stereo 1170

Android拖拽详解

Android中实现拖拽其实很简单,系统早已经提供了api让我使用,主要用到了View的startDrag(startDragAndDrop API24+) 方法以及OnDragListener。 startDrag 先来看下方法介绍: /** * Starts a drag and drop operation. When your application calls this met...

weixin_33795806的博客 932

startDrag()中的bounds参数的理解

<br />API中解释的不是很清楚。<br />实际上可以理解为 sprite左上顶点的活动范围,就是这个左上顶点只能在bounds所指定的矩形区域中移动。

wbn1984的专栏 1167

stopDrag

stopDrag 可用性 Flash Player 4。 用法 stopDrag() 参数 无。 返回 无。 说明 动作;停止当前的拖动操作。

xrosss的专栏 532

delphi拖放编程的要素、事件流程和可能的陷阱

一、拖放的要素 鼠标拖放的二个操作对象:源对象(source)和目标对象(Target)。鼠标左键在源控件(source)上按下拖动,直至可接收目标控件(Target)上放下,即完成一次拖放操作。有四个事件拖放事件依序发生:OnStartDrag,OnDragOver,OnDragDrop,OnEndDrag。按事件名的字义理解这四个事件就对了,OnDragOver和OnDragDrop由目标对

king_xing的专栏 3962
上一篇: [ActionScript 3] 内存清理
下一篇: 第一篇 AS的冒泡例子
我是一纸巾
博客等级 码龄12年 14粉丝 37原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值