在表单上绘制多个位图? [英] Drawing multiple bitmaps on a form?

查看:100
本文介绍了在表单上绘制多个位图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在从事的项目几乎已经完成,直到我的老板决定他想要更多并且有所不同(您不只是讨厌它吗?).

所以..我有一个表单,我用它来显示我的应用程序生成的计划(存储在单个位图-不是图像文件,而是位图对象中).现在的问题是,我必须在该表格上没有一个,但要有更多的计划(因此需要更多的位图对象).最初,位图对象是使用某些我的apps方法生成的,然后使用drawImage方法将该对象显示在表单中.
我当时想解决这个新问题的最简单方法是将我的位图对象替换为一组位图对象,然后在其之前的每个对象之后显示每个对象(在窗体下方).还有另一种方法吗?

The project I was working on was nearly complete, until my boss decided he wants more and a bit different (don''t you just hate it?).

So..I have a form and i use it to display my app generated plans (stored in a single bitmap -not image file, but bitmap object). Now the problem is I have to have on that form not one, but more plans (hence more bitmap objects). Initially the bitmap object were generated using some of my apps methods and then the object was displayed within the form using the drawImage method.
I was thinking the easiest way to solve the new problem is to replace my bitmap object with an array of bitmap objects and then display each one after the one before it (lower on the form). is there another way to do it?

推荐答案

我唯一能想到的内置组件是ListView,并且View属性设置适当( c2>可能).

除此之外,我认为最好的方法几乎是您所建议的,或者使用TabControl,每个选项卡使用一张图像,并以计划名称作为选项卡文本.
The only built in component that I can think of is the ListView with the View property set appropriately (LargeIcon maybe).

Other than that I would think that the best way would be pretty much as you suggest, or maybe use a TabControl, one image per tab with the plan name as the tab text.


您总是可以在窗体上设置自上而下的样式的流控制面板,然后一次向其中添加图片控件.如果您的图片控件大于窗体(例如,从上到下较长),您甚至可以将auto scroll设置为true.滚动条将自动出现.

只是一个想法,但是我在创建一个快速且肮脏的imagelist框之前就已经这样做了. :)
You could always put a flow control panel on your form with top down style set and add picture controls to it one at a time. You could even set auto scroll to true and that way if your picture controls are larger than the form(ie. longer from top to bottom). The scroll bar will appear automatically.

Just a thought, but I have done this before to create a quick and dirty imagelist box. :)


这篇关于在表单上绘制多个位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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