当前位置:网站首页>C WinForm [realize the previous and next selection pictures] - practice 7
C WinForm [realize the previous and next selection pictures] - practice 7
2022-07-05 07:55:00 【BoomBiuBiu】
In the process of traversing the picture , Sometimes we need to select a suitable picture in the document for application , This function is to adapt to this scenario .
1、 Double click the previous button
private void button2_Click(object sender, EventArgs e)
{
index--;
// Determine whether the array index has been found
if (index < 0)
{
index = path.Length - 1;
}
// Total number of pictures to be detected
toolStripStatusLabel2.Text = path.Length.ToString();
// Current number of pictures
toolStripStatusLabel4.Text = (index + 1).ToString();
// Read the picture
HOperatorSet.ReadImage(out ho_Image, path[index]);
HOperatorSet.DispObj(ho_Image, hv_WindowHandle);
}
2、 Double click the next button
private void button1_Click(object sender, EventArgs e)
{
index++;
// Determine whether the array index has been found
if (index > path.Length - 1)
{
index = 0;
}
// Total number of pictures to be detected
toolStripStatusLabel2.Text = path.Length.ToString();
toolStripStatusLabel4.Text = (index + 1).ToString();
// Read the picture
HOperatorSet.ReadImage(out ho_Image, path[index]);
HOperatorSet.DispObj(ho_Image, hv_WindowHandle);
}
边栏推荐
- Latex notes
- Extern keyword function
- Software designer: 03 database system
- Altium designer 19.1.18 - clear information generated by measuring distance
- Fundamentals of C language
- C language enhancement -- pointer
- Could NOT find XXX (missing: XXX_LIBRARY XXX_DIR)
- assert_ Usage of param function
- Altium Designer 19.1.18 - 导入板框
- Global and Chinese market of rammers 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢
Reasons for rapid wear of conductive slip rings
找不到实时聊天软件?给你推荐电商企业都在用的!
Openxlsx field reading problem
UEFI development learning 6 - creation of protocol
Screen record of the opening ceremony of the Beijing winter olympics 2
Software designer: 03 database system
Acwing-宠物小精灵之收服-(多维01背包+正序倒序+两种形式dp求答案)
Connection mode - bridge and net
Package ‘*****‘ has no installation candidate
[untitled] record the visual shock of the Winter Olympics and the introduction of the display screen
随机推荐
STM32 learning method
MySQL blind note common functions
Openxlsx field reading problem
Interview catalogue
Software designer: 03 database system
msys2
Record the opening ceremony of Beijing Winter Olympics with display equipment
The research found that the cross-border e-commerce customer service system has these five functions!
生产中影响滑环质量的因素
2021-10-28
Good websites need to be read carefully
Global and Chinese markets for waste treatment air switches 2022-2028: Research Report on technology, participants, trends, market size and share
Linked list (establishment, deletion, insertion and printing of one-way linked list)
Makefile application
Numpy——1.数组的创建
Use stm32cubemx tool to write the demo program of FreeRTOS
1089 Insert or Merge 含测试点5
Altium designer 19.1.18 - clear information generated by measuring distance
Function and usage of function pointer
导电滑环磨损快的原因