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 4861 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@_Remove This_centurion-ms.co.uk> a écrit dans le message
de news:%2******** *******@TK2MSFT NGP15.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.FromIm age(b)
g.FillRectangle (New SolidBrush(Colo r.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@_Remove This_centurion-ms.co.uk> a écrit dans le message
de news:OC******** ******@TK2MSFTN GP14.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******** ******@TK2MSFTN GP15.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@_Remove This_centurion-ms.co.uk> a écrit dans le message de news:%2******** *******@TK2MSFT NGP15.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******** ******@TK2MSFTN GP15.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@_Remove This_centurion-ms.co.uk> a écrit dans le message de news:%2******** *******@TK2MSFT NGP15.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******** *****@TK2MSFTNG P12.phx.gbl...
You could create a bitmap using :
Dim b As New Bitmap(32, 32) Dim g As Graphics = Graphics.FromIm age(b)
g.FillRectangle (New SolidBrush(Colo r.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@_Remove This_centurion-ms.co.uk> a écrit dans le message de news:OC******** ******@TK2MSFTN GP14.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******** ******@TK2MSFTN GP15.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@_Remove This_centurion-ms.co.uk> a écrit dans le > message > de news:%2******** *******@TK2MSFT NGP15.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 takes two minutes to complete.
I am using the Panel's Paint event to call my drawing method, which accepts PaintEventArgs as a parameter. The problem is that every time the Window is moved or hidden, it needs to be repainted, which takes a long time...
|
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 a Bitmap object of a webpage from, say,
the new WebBrowser control of .net 2.0 or even the old ActiveX browser
control, without opening any forms.
I tried with the new WebBrowser control, but the only thing I've managed
to do is open up a form...
|
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 after a while). Can somebody
please tell me what I'm doing wrong? Here is a sample:
Public Shared Function CreateBitmapFromArray( _
ByVal width As Integer, _
ByVal height As Integer, _
ByVal pixelFormat As Drawing.Imaging.PixelFormat, _
|
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 System.Drawing.Bitmap from that value?
Regards,
Steve
| |
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 bitmap
file out of this control, so the bitmap will show what the control is showing.
I tried this:
/////////////////////////////////////////////////////////////////
AxTheControl.AxControl ctrl = new AxTheControl.AxControl();
|
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 boundary of the raster image(bitmap) is blurry. i used Interpolation mode,smoothing mode,,and tried a lot ..... i cant able to solve this problem in C#...Please help me to solve this......
Regards,
alarock(algates)
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |