首页 > 其他分享 >winCE 页面绘制 例子一则

winCE 页面绘制 例子一则

时间:2023-04-06 18:03:46浏览次数:39  
标签:currentPath winCE System private new using 绘制 rectangle 页面


 

效果如下:

 

winCE 页面绘制 例子一则_wince

 


 


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
 
using System.IO;
using System.Reflection;
using System.Drawing.Imaging;
 
namespace testWinCeGraphics
{
    public partial class Form1 : Form
    {
        private string currentPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase);//获取PDA路径
        private Bitmap bg, title,btn;
 
        private Rectangle rectangle;
        Color transpColor = Color.FromArgb(255, 0, 255);//资源文件的透明色
        ImageAttributes imageAttr;
 
        public Form1()
        {
            InitializeComponent();
        }
 
        private void Form1_Load(object sender, EventArgs e)
        {
            bg = new Bitmap(currentPath + @"\image\bg294.jpg");
            title = new Bitmap(currentPath + @"\image\title.jpg");
 
            btn = new Bitmap(currentPath + @"\image\button.bmp");
            rectangle = new Rectangle(10, 60,219,48);
            //rectangle = new Rectangle();
            imageAttr = new ImageAttributes();
            imageAttr.SetColorKey(transpColor, transpColor);
        }
 
        private void Form1_Paint(object sender, PaintEventArgs e)
        {
            e.Graphics.DrawImage(bg, 0, 0);
            e.Graphics.DrawImage(title, 0, 0);
            //要更改图片显示请更改rectangle中x,y轴的坐标
            e.Graphics.DrawImage(btn, rectangle, 0, 0, 219, 48, GraphicsUnit.Pixel, imageAttr);
 
            //写字
            Font sFont = new Font(FontFamily.GenericSansSerif, 16, FontStyle.Bold);
            e.Graphics.DrawString("入库管理",sFont,new SolidBrush(Color.Red),50,70);
 
        }
 
 
 
    }
}



标签:currentPath,winCE,System,private,new,using,绘制,rectangle,页面
From: https://blog.51cto.com/u_15999672/6173930

相关文章

  • vue3中路由错误自动跳转404页面 路由表写法
    定义路由表import{createRouter,createWebHashHistory}from"vue-router";constroutes=[ { path:"/", name:"home", component:Home, },//... { path:"/404", name:"404", component:()=&......
  • [K/3Cloud] 首页增加一个自定义页签及页面内容
    在K3Cloud登录后的门户首页增加一个页签,如增加一个【BBS论坛】 2013-7-3011:18:51上传下载附件 (84.81KB) 增加页签   可以这么来做:进入BOSIDE,找到名称为主控台经典版,唯一标识为BOS_MainConsoleSutra的动态表单;为它写一个继承自AbstractDynamicFormPl......
  • canvas绘制3D金字塔
    varcanvas1=document.getElementById("canvas1");varcontext=canvas1.getContext("2d");canvas1.width=400;canvas1.height=400;context.beginPath();context.moveTo(0,360);context.lineTo(200,400);context.lineTo(400,360)......
  • Selenium-处理弹窗弹出新页面的切换问题
    WebDriverWaitwait=newWebDriverWait(driver,TimeSpan.FromSeconds(60));wait.Until(driver=>{returndriver.WindowHandles.Count==waitforHandlesCount;});stringcurrent_handler=driver.Curren......
  • uni-app:ios/android中的nvue和vue页面加载自定义字体(hbuilderx 3.7.3)
    一,官方文档地址:https://uniapp.dcloud.net.cn/tutorial/nvue-api.html#addrule二,代码1,nvue页面:模板<viewclass="listTitle">{{item.title}}</view>......
  • WebGL初学:使用WebGL绘制一个点
    示例代码<!DOCTYPEhtml><htmllang="en"><head><metacharset="UTF-8"><title>使用WebGL绘制一个点</title></head><body><!--canvas标签创建一个宽高均为500像素,背景为蓝色的矩形画布--><canvasi......
  • WebGL-实例化绘制
    今天来学习webgl一个重要功能:InstancedDrawing(实例化绘制),内容翻译自webgl学习网站webglfundamentals(由于英语水平尽量按原文翻译):https://webglfundamentals.org/webgl/lessons/webgl-instanced-drawing.html。WebGL下个版本(WebGL2.0)有一个功能叫实例化绘制。它的基本思想......
  • Cesium实例化绘制(Instanced Drawing)
    上篇《WebGL-实例化绘制》我们学习了实例化webgl底层实现原理,基于webgl1.0标准的扩展。这篇博客我们来了解下cesium引擎是如何支持实例化功能的。该篇公众号主要参考了博客:《Cesium原理篇:6Render模块(6:Instance实例化)》。假如有这样的需求:有四个不同颜色的点,它们的相对位置(......
  • iOS - 利用 UIBezierPath 绘制圆弧
    iOS-利用UIBezierPath绘制圆弧APIUIBezierPath绘制圆弧主要利用以下方法:openfuncaddArc(withCentercenter:CGPoint,radius:CGFloat,startAngle:CGFloat,endAngle:CGFloat,clockwise:Bool)方法中各参数含义:center:圆心radius:半径startAngle:开始弧度endAn......
  • EasyUI闪屏,EasyUI页面加载提示:原理+代码+效果图
    使用EasyUI时,有个经常遇到的问题,页面还没有渲染完成的时候,就展现了。刚刚开始很混乱,等加载完成后,就好了。    $.parser.onComplete,这个是在所有组件解析完成后执行的事件。其实这个事件很有用的。很多在布局用到easyui的时候总会出现一个问题。就是在一进入主界面的时候,页......