ColorPalette类没有构造函数,那么如何使用它呢? [英] The ColorPalette class has no constructor so how does one use it?

查看:279
本文介绍了ColorPalette类没有构造函数,那么如何使用它呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ColorPalette类没有构造函数,所以如何使用它?

我通过以下方式定义变量:

Dim cp as ColorPalette


但不知道如何将一个对象分配给变量。


提前致谢


The ColorPalette class has no constructor so how does one use it?
I define a variable by:

Dim cp as ColorPalette

but don''t know how assign an object to the variable.

Thanks in advance


推荐答案

2007年7月14日星期六13:49:13 -0400,"活跃的

< ac ********** @ a-znet.comwrote:
On Sat, 14 Jul 2007 13:49:13 -0400, " active"
<ac**********@a-znet.comwrote:

> ColorPalette class没有构造函数所以如何使用它?
我通过以下方式定义变量:

Dim cp作为ColorPalette

但不知道如何分配对象变量。
>The ColorPalette class has no constructor so how does one use it?
I define a variable by:

Dim cp as ColorPalette

but don''t know how assign an object to the variable.



如果没有构造函数,那么你只能从

其他对象获得一个ColorPalette。例如:


Dim cp As ColorPalette

Dim bmp As Bitmap = New Bitmap(" figure2.bmp")


cp = bmp.Palette

If there is no constructor, then you can only get a ColorPalette from
other objects. For example:

Dim cp As ColorPalette
Dim bmp As Bitmap = New Bitmap("figure2.bmp")

cp = bmp.Palette


等另一张海报说...


只需创建1x1位图适当的位深度,并将它的颜色调整为你的变量。


它不优雅,但它是唯一的方式。


"活性" < ac ********** @ a-znet.com写了留言

新闻:%2 **************** @ TK2MSFTNGP04.phx.gbl ...
Lke the other poster says...

Just create a 1x1 bitmap of the appropriate bit depth and retrieve it''s
color palette into your variable.

It''s not elegant, but it''s the only way.

" active" <ac**********@a-znet.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...

ColorPalette类没有构造函数,所以如何使用它?

我通过以下方式定义变量: :


Dim cp作为ColorPalette


但不知道如何将一个对象分配给变量。

提前致谢


The ColorPalette class has no constructor so how does one use it?
I define a variable by:

Dim cp as ColorPalette

but don''t know how assign an object to the variable.

Thanks in advance




谢谢


杰克杰克逊 < ja ******** @ pebbleridge.comWrote in message

news:nm ********************** ********** @ 4ax.com ...
thanks

"Jack Jackson" <ja********@pebbleridge.comwrote in message
news:nm********************************@4ax.com...

On Sat,2007年7月14日13:49:13 -0400,"活跃的

< ac ********** @ a-znet.comwrote:
On Sat, 14 Jul 2007 13:49:13 -0400, " active"
<ac**********@a-znet.comwrote:

>> ColorPalette类没有构造函数,所以如何使用它?
我通过以下方式定义变量:

Dim cp作为ColorPalette

但不知道如何将对象分配给变量。
>>The ColorPalette class has no constructor so how does one use it?
I define a variable by:

Dim cp as ColorPalette

but don''t know how assign an object to the variable.



如果没有构造函数,那么你只能从

其他对象获得一个ColorPalette。例如:


Dim cp As ColorPalette

Dim bmp As Bitmap = New Bitmap(" figure2.bmp")


cp = bmp.Palette


If there is no constructor, then you can only get a ColorPalette from
other objects. For example:

Dim cp As ColorPalette
Dim bmp As Bitmap = New Bitmap("figure2.bmp")

cp = bmp.Palette



这篇关于ColorPalette类没有构造函数,那么如何使用它呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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