• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >微信小程序 > 微信小程序开发--如何制作表白图片?

微信小程序开发--如何制作表白图片?

作者:匿名 字体:[增加 减小] 来源:互联网 时间:2018-11-30

匿名通过本文主要向大家介绍了小程序等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
大家可能都会在抖音上刷过,那种表白小程序,但在我看来表白还是亲口说出来比较好,这类小程序只适合在平常的一些小节日给对方一个惊喜。话不多说,现在进入正题:

首先,要在电脑上安装微软的编译软件,我这里是使用的VS2017,安装的时候如果没有别的需要,直接选择下载wpf的组件就好。否则,下载量大,安装时间长。

安装完之后,点击文件,新建项目,选择wpf应用

1.png

然后是窗口设计,代码如下:

<Window x:Name="closing" x:Class="BBdemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:lacal="clr-namespace:BBdemo"
        mc:Ignorable="d"
        Title="******窗口标题(我的是大宝贝***)" Height="450" Width="800" Closing="closing_Closing">
    <Grid>
        <Grid.Background>
            <ImageBrush/>
        </Grid.Background>
        <Button Name="btn1" Content="好" HorizontalAlignment="Left" Margin="168,326,0,0"
VerticalAlignment="Top" Width="93" Height="42" Click="Button_Click"/>
        <Label Name="lab1" Content="小可爱**:" HorizontalAlignment="Left" Margin="1,4,0,0"
VerticalAlignment="Top" Height="59" Width="218" FontSize="36" FontStyle="Italic"/>
        <Label Name="lab2" Content="永远做我的小宝贝好吗&#xD;&#xA;&#x9;"
HorizontalAlignment="Left" Height="60" Margin="398,200,0,0" VerticalAlignment="Top"
Width="384" FontSize="36"/>
        <Button Name="btn3" Visibility="Hidden"  Content="退出" HorizontalAlignment="Left"
Height="42" Margin="326,326,0,0" VerticalAlignment="Top" Width="90" Click="Button_Click_1"/>
        <Image x:Name="biaobai" Margin="168,10,399,109" Source="biaobai.png" RenderTransformOrigin="0.362,0.515"/>
        <Button Name="btn2" Content="不好" HorizontalAlignment="Left" 
Margin="493,326,0,0" VerticalAlignment="Top" Width="93" Height="42" 
MouseEnter="Button_MouseEnter"/>
    </Grid>
</Window>

效果如下:

1.png 然后是代码,鼠标检测那些:

using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Imaging;using System.Windows.Navigation;using System.Windows.Shapes;
namespace BBdemo{    /// <summary>    /// MainWindow.xaml 的交互逻辑    /// </summary>    public partial class MainWindow : Window    {        public MainWindow()        {            InitializeComponent();        }        private void Button_MouseEnter(object sender, MouseEventArgs e)        {            Random rd = new Random();            Button btn = sender as Button;            double maxW = this.Width;            double maxH = this.Height;            double w = btn.Width;            double h = btn.Height;            double l = rd.Next(0, (int)(maxW - w));            double t = rd.Next(0, (int)(maxH - h));            btn.Margin = new Thickness(1, t, 0, 0);        }
        private void closing_Closing(object sender, System.ComponentModel.CancelEventArgs e)        {            MessageBox.Show("不许关!");            e.Cancel = true;        }        private void Button_Click(object sender, RoutedEventArgs e)        {            lab1.Visibility = System.Windows.Visibility.Hidden;            lab2.Content = "谢谢媳妇!";            btn3.Visibility = System.Windows.Visibility.Visible;            btn2.Visibility = System.Windows.Visibility.Hidden;            btn1.Visibility = System.Windows.Visibility.Hidden;        }
        private void Button_Click_1(object sender, RoutedEventArgs e)        {            System.Environment.Exit(0);        }    }}

好了,一个表白小程序就弄好了,生成解决方案之后,就可以在工程文件中找到.exe的程序,提取出来,发给对方即可。

tips:程序中的图片,自己替换,在项目中添加现有项,选择图像格式,在选中你找到的图片,点击确认即可。

相关文章:

微信小程序开发图片压缩功能

微信小程序怎么开发之微信小程序开发高清图文教程

以上就是微信小程序开发--如何制作表白图片?的详细内容,更多请关注微课江湖其它相关文章!

分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

相关文章

  • 2018-11-30header组件的使用方法
  • 2018-11-30小程序授权第三方管理开发的步骤(小程序教程)
  • 2018-11-30微信小程序开发使用video组件实现播放视频代码
  • 2018-11-30微信小程序:微信小程序简介
  • 2018-11-30怎么在微信小程序里做出全局搜索代码高亮提醒
  • 2018-11-30从零开始开发微信小程序步骤(三)
  • 2018-11-30微信开发之录音功能
  • 2018-11-30微信小程序如何获取相册照片
  • 2018-11-30 微信小程序三个视图控件View、ScrollView、Swiper的解读及示例
  • 2018-11-30微信小程序之弹幕的代码实现

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • webpack如何动态引入文件
    • 微信小程序表单验证功能完整实例
    • 微信小程序地图定位demo代码示例
    • 解析微信小程序SocketIO实例
    • 千锋教育微信小程序开发视频教程的资源介绍
    • 如何解决微信小程序报错:this.setData is not a function的问题
    • 小程序中授权相册的解决办法(附代码)
    • 微信小程序 开发过程中出现的问题总汇
    • 关于微信小程序设置http请求的步骤
    • 微信小程序如何获取用户session_key,openid,unioni(代码)

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有