图片的切换与位置的移动
来源:互联网 发布:.手机域名 编辑:程序博客网 时间:2024/04/28 14:20
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Left:
Y -= Math.Sin(Q) * 10;
X -= Math.Cos(Q) * 10;
this.pictureBox1.Location = new Point((int)X ,(int)Y); break;
//case Keys.Right:
// this.pictureBox1.Location.X += 45; break;
//case Keys.Up:
// this.pictureBox1.Location.Y -= 45; break;
//case Keys.Down:
// this.pictureBox1.Location.Y += 45; break;
//default:
// break;
}
}
private void Form1_Load(object sender, EventArgs e)
{
this.pictureBox1.Location = new Point(0, 0);
}
static double X = 1;
static double Y = 1;
static int Q = 45;
static bool flag = true;
private void button1_Click(object sender, EventArgs e)
{
Y += Math.Sin(Q)*10;
X += Math.Cos(Q)*10;
this.pictureBox1.Location = new Point((int)X, (int)Y);
if (flag==true)
{
pictureBox1.Image = imageList1.Images[0];
flag = false;
}
else
{
flag = true;
pictureBox1.Image = imageList1.Images[1];
}
}
}
}
- 图片的切换与位置的移动
- HTML 里面的图片怎么移动位置?
- 切换同一个位置上的图片setCompoundDrawables
- 页面位置的切换
- 位置的移动
- 移动桌面图标的位置
- 移动 view 的位置
- 适合移动mobile的css3弹性堆叠图片切换特效
- 自定义UIButton 图片与label的位置
- 移动View位置时,修改图片资源导致View在原位置闪烁的问题
- android 控件的位置移动处理,利用bitmap来不断更新图片位置
- 简单的pc端与移动端的切换效果
- 在使用viewPager做图片切换时注意图片存放的位置
- UITableView移动cell位置(附在不同section之间切换的拓展)
- 拼图游戏图片的分割与移动
- 图片的缩、放与自由移动
- 移动SQL SERVER数据库的数据与日志文件位置
- JQuery 图片移动位置
- 更改eclipse插件svn用户、更换安装TortoiseSVN用户
- C# 给某个方法设定执行超时时间
- 让你的 C 程序更有效率的 10 种方法
- csanf()
- LINUX下的C编程入门(二)文件系统编程
- 图片的切换与位置的移动
- C#中设置Socket连接请求的超时
- 怎样拜访客户
- 在ASP.NET中如何实现和利用URL重写
- Android安卓2.2系统21个小技巧
- 列出目录下的所有文件
- 引用数组与数组引用
- js预处理
- 《系统程序员成长计划》学习交流(1)-防止查找结点失败