C#中的图片框控件 [英] picture box control in C#

查看:71
本文介绍了C#中的图片框控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果这是错误的论坛,请转移到正确的论坛.我正在使用C#.NET,需要创建一个具有列和行的图片框控件,以便可以为每个单元格分配一个值(数据类型,int).请问我该怎么做?
图片框将加载图像,但应该足够敏感",以知道鼠标何时将其悬停在任何单元格上.

If this is the wrong forum please transfer to the correct forum. I am using C#.NET and I need to create a picturebox control with columns and row, such that I can assign a value (data type , int) to each cell . Please how can I do this?
The picture box would load an image but should be "sensitive" enough to know when the mouse hovers any cell.

Ok. Whatever the control you recommend, please can you give some sample code? Can someone give some sample code for whatever control you think is appropriate for this

推荐答案

这是一个新的.很多人想要一个相框来做愚蠢的事情,但这很可取.图片框显示图片.如果使用某种网格或编写自己的控件,则图片框在这里无济于事.
This is a new one. A lot of people want a picture box to do stupid things, but this takes the cake. A picture box shows a picture. USe a grid of some sort, or write your own control, a picture box will not help you here.


Please allow me to offer more clarification:
The picture box control is expected to load an image. This image is actually a map (saved as a *.jpeg file) and it should be divided into cells (hence the need for the columns and rows). Each cell is assigned a value (the weight) which is a consequent of the prevailing condition at that area (topography).

If you recommend a "TableLayoutPanel of a grid view ", please can I get some sample code? I need to be able to assign a "weight" to each cell.
 If a need to subclass the TableLayoutPanel kindly point me in the right direction.

The platform is   win forms.
Any idea?


您仍在要求图片框来做它不知道如何做的事情,并可能使它对您来说更难要做到这一点,b/c无法确定图片框如何调整图片大小.使用网格,您必须将jpeg分解为单元格.我仍然倾向于只在窗体上绘制图片,然后用代码计算出列和行,尤其是它们的大小相同时.
You''re still asking a picture box to do stuff it has no idea how to do, and making it likely that it''s harder for you to do it, b/c you can''t work out how a picture box resizes a picture. Using a grid, you''d have to break your jpeg up in to cells. I''d still be inclined to just paint your picture on the form, and work out your columns and rows in code, esp if they are all the same size.


这篇关于C#中的图片框控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆