\*
* <p>
* 方法名:drawClipImage
* </p>
* <p>
* 方法描述:绘制切割区域图片
* </p>
* <p>
* 输入参数:Graphics g:绘图类;Image image:需要绘制的图片对象;int x:绘制横坐标;int y:绘制纵坐标;int row:图片总行数;int col:图片总列数;int index:子图片的索引。
* </p>
* <p>
* 输出参数:void:任意类型
* </p>
* <p>
* 创建人:***
* </p>
* <p>
* 创建时间:2009-12-09
* </p>
*\
protected void drawClipImage(Graphics g, Image image, int x, int y, int row, int col, int index)
{
Region rect = g.Clip;
int sgWidth = image.Width / col;
int sgHeight = image.Height / row;
g.Clip = new Region(new Rectangle(x, y, sgWidth, sgHeight));
this.drawTransBGImage(g, image, x - index % col * sgWidth, y - index / col * sgHeight);
g.Clip = rect;
}
protected void drawText(Graphics g, string txt, Font font, Color color, int x, int y)
{
if (font == null)
{
font = new Font("宋体", 8, FontStyle.Regular);
}
g.DrawString(txt, font, new SolidBrush(color), x, y);
font.Dispose();
}
public static void DrawTime(string time, Graphics gx, int x, int y)
{
Font timeFont = new Font("Tahoma", 32, FontStyle.Regular);
SizeF size = gx.MeasureString(time, timeFont);
gx.DrawString(time, timeFont, new SolidBrush(Color.WhiteSmoke), x, y);
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;
using System.IO;
using System.Runtime.InteropServices;
namespace FlashWindows
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();