Hi all
I have an ARGB value for a Colour (Eg. -65536. The value was retrieved by
using the Color.ToArgb method), is there any way that I can create a
System.Drawing.Image or a System.Drawing.Bitmap from that value?
Regards,
Steve 5 4815 http://www.vbdotnetheaven.com/Sections/GDI+.asp
Steve Amey wrote: Hi all
I have an ARGB value for a Colour (Eg. -65536. The value was retrieved by using the Color.ToArgb method), is there any way that I can create a System.Drawing.Image or a System.Drawing.Bitmap from that value?
Regards, Steve
"From this value" is a bit vague. Do you mean you would like to create a
32x32 bitmap file that is filled with this particular color or something
similar...
If yes you may want to post the exact point that causes a problem (creating,
filling, saving etc...)
The doc for the System.Drawing namespace is at : http://msdn.microsoft.com/library/de...temDrawing.asp
Patrice
--
"Steve Amey" <stevea@_RemoveThis_centurion-ms.co.uk> a écrit dans le message
de news:%2***************@TK2MSFTNGP15.phx.gbl... Hi all
I have an ARGB value for a Colour (Eg. -65536. The value was retrieved by using the Color.ToArgb method), is there any way that I can create a System.Drawing.Image or a System.Drawing.Bitmap from that value?
Regards, Steve
You could create a bitmap using :
Dim b As New Bitmap(32, 32)
Dim g As Graphics = Graphics.FromImage(b)
g.FillRectangle(New SolidBrush(Color.Blue), 0, 0, 32, 32)
g.Dispose()
Just use the color you want instead of Color.Blue. Not sure but depending on
the grid you are using you could also likely just alter the cell color
background (if possible) instead of using a colored bitmap.
Note that having the compoent is useless. you can use the Color object you
have...
Patrice
--
"Steve Amey" <stevea@_RemoveThis_centurion-ms.co.uk> a écrit dans le message
de news:OC**************@TK2MSFTNGP14.phx.gbl... Hi Patrice
Sorry if I'm being vague. I want to create a Bitmap or Image that is the exact colour of the Argb values I have, then assign that Image or Bitmap
to a column in a Grid Control I have. I don't need to actually save the Image anywhere, it will only exist while the application is running.
The problem is I don't know how to create a Bitmap or Image object that
will display the Colour of the Argb values.
Regards, Steve.
"Patrice" <no****@nowhere.com> wrote in message news:uy**************@TK2MSFTNGP15.phx.gbl... "From this value" is a bit vague. Do you mean you would like to create a 32x32 bitmap file that is filled with this particular color or something similar...
If yes you may want to post the exact point that causes a problem (creating, filling, saving etc...)
The doc for the System.Drawing namespace is at :
http://msdn.microsoft.com/library/de...temDrawing.asp Patrice
--
"Steve Amey" <stevea@_RemoveThis_centurion-ms.co.uk> a écrit dans le message de news:%2***************@TK2MSFTNGP15.phx.gbl... Hi all
I have an ARGB value for a Colour (Eg. -65536. The value was retrieved
by using the Color.ToArgb method), is there any way that I can create a System.Drawing.Image or a System.Drawing.Bitmap from that value?
Regards, Steve
Hi Patrice
Sorry if I'm being vague. I want to create a Bitmap or Image that is the
exact colour of the Argb values I have, then assign that Image or Bitmap to
a column in a Grid Control I have. I don't need to actually save the Image
anywhere, it will only exist while the application is running.
The problem is I don't know how to create a Bitmap or Image object that will
display the Colour of the Argb values.
Regards,
Steve.
"Patrice" <no****@nowhere.com> wrote in message
news:uy**************@TK2MSFTNGP15.phx.gbl... "From this value" is a bit vague. Do you mean you would like to create a 32x32 bitmap file that is filled with this particular color or something similar...
If yes you may want to post the exact point that causes a problem (creating, filling, saving etc...)
The doc for the System.Drawing namespace is at :
http://msdn.microsoft.com/library/de...temDrawing.asp
Patrice
--
"Steve Amey" <stevea@_RemoveThis_centurion-ms.co.uk> a écrit dans le message de news:%2***************@TK2MSFTNGP15.phx.gbl... Hi all
I have an ARGB value for a Colour (Eg. -65536. The value was retrieved by using the Color.ToArgb method), is there any way that I can create a System.Drawing.Image or a System.Drawing.Bitmap from that value?
Regards, Steve
Lovely. Thank you for your help Patrice :o)
I could've changed the Backcolor of the Cell but I wanted more control over
the size of the image so that it doesn't fill the entire cell, changing the
size of the Bitmap and assigning it to the column looks really good.
Regards,
Steve
"Patrice" <no****@nowhere.com> wrote in message
news:eu*************@TK2MSFTNGP12.phx.gbl...
You could create a bitmap using :
Dim b As New Bitmap(32, 32) Dim g As Graphics = Graphics.FromImage(b)
g.FillRectangle(New SolidBrush(Color.Blue), 0, 0, 32, 32)
g.Dispose() Just use the color you want instead of Color.Blue. Not sure but depending on the grid you are using you could also likely just alter the cell color background (if possible) instead of using a colored bitmap. Note that having the compoent is useless. you can use the Color object you have...
Patrice
--
"Steve Amey" <stevea@_RemoveThis_centurion-ms.co.uk> a écrit dans le message de news:OC**************@TK2MSFTNGP14.phx.gbl... Hi Patrice
Sorry if I'm being vague. I want to create a Bitmap or Image that is the exact colour of the Argb values I have, then assign that Image or Bitmap to a column in a Grid Control I have. I don't need to actually save the Image anywhere, it will only exist while the application is running.
The problem is I don't know how to create a Bitmap or Image object that will display the Colour of the Argb values.
Regards, Steve.
"Patrice" <no****@nowhere.com> wrote in message news:uy**************@TK2MSFTNGP15.phx.gbl... > "From this value" is a bit vague. Do you mean you would like to create > a > 32x32 bitmap file that is filled with this particular color or > something > similar... > > If yes you may want to post the exact point that causes a problem > (creating, > filling, saving etc...) > > The doc for the System.Drawing namespace is at : > > http://msdn.microsoft.com/library/de...temDrawing.asp > > Patrice > > -- > > "Steve Amey" <stevea@_RemoveThis_centurion-ms.co.uk> a écrit dans le > message > de news:%2***************@TK2MSFTNGP15.phx.gbl... >> Hi all >> >> I have an ARGB value for a Colour (Eg. -65536. The value was retrieved by >> using the Color.ToArgb method), is there any way that I can create a >> System.Drawing.Image or a System.Drawing.Bitmap from that value? >> >> Regards, >> Steve >> >> > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Prashant |
last post by:
Hi,
I have a huge problem. I have a data file which looks something like
this -:
..1 .5 .9 -1 .2 .5 ......
..2 .9 .1 .4 .3 -1 ......
..2 .4 .5 .7 .6 .2 ......
........
|
by: Bradford |
last post by:
I have an Windows application that displays lots of different colored lines in a Panel by using the Graphics.DrawLine method. The location and length of each line comes from a database query that...
|
by: Joe Black |
last post by:
Hi everyone,
I have a pesky little problem that is driving me nuts.
I'm trying to capture an image of a web page programmatically in a
background thread or process.
What I'd like to do is create...
|
by: Lance |
last post by:
I need to create a Drawing.Bitmap from an array of integer
values. My current technique creates a bitmap that
eventually becomes corrupt (i.e., the bitmap's pixels
change to a different color...
|
by: Steve Amey |
last post by:
Hi all
I have an ARGB value for a Colour (Eg. -65536. The value was retrieved by
using the Color.ToArgb method), is there any way that I can create a
System.Drawing.Image or a...
| |
by: =?Utf-8?B?U2hhcm9u?= |
last post by:
Hello,
I'm using a control (black box control) in my form (an ActiveX/Com control).
and I need to take the control as an image.
The controls is showing some kind of graph, and I want to create a...
|
by: alarock |
last post by:
hi,
I have performed some drawing using Vector image,DrawRectangle etc... and then i converted to raster Image(bitmap)
i found in the zoomed raster image(bitmap) the outer...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |