Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » To change the color of the image in the cell
To change the color of the image in the cell [message #21749] Wed, 03 January 2007 04:55 Go to next message
Eclipse User
Originally posted by: krishna_24jan.yahoomail.com

Hi,

Iam adding an image in a grid item by using griditem.setImage.

Now i want to change the color of the image with out changing the image.

Iam trying to use gridItem.setForeground but its not working.

Can i dynamically draw the image in the cell.Imean if i want a round image
can i dynamically draw in the code with out statically placing the image..?

or any other suggestions to sove my problem..?



Thanks in advance
krishna
Re: To change the color of the image in the cell [message #22019 is a reply to message #21749] Thu, 04 January 2007 16:26 Go to previous messageGo to next message
Chris Gross is currently offline Chris Gross
Messages: 253
Registered: July 2009
Senior Member
The Grid will not alter the image for you. You can create your own
image and then set it to the item. For example:

Image image = new Image(display,16,16);
GC gc = new GC(image);
//draw stuff
gc.dispose();
gridItem.setImage(2,image);


-Chris

krishna wrote:
> Hi,
>
> Iam adding an image in a grid item by using griditem.setImage.
>
> Now i want to change the color of the image with out changing the image.
>
> Iam trying to use gridItem.setForeground but its not working.
>
> Can i dynamically draw the image in the cell.Imean if i want a round
> image can i dynamically draw in the code with out statically placing the
> image..?
>
> or any other suggestions to sove my problem..?
>
>
>
> Thanks in advance
> krishna
>
Re: To change the color of the image in the cell [message #29063 is a reply to message #21749] Tue, 13 February 2007 18:03 Go to previous message
Kathiravan  is currently offline Kathiravan
Messages: 33
Registered: July 2009
Member
you have to create the image with the different color on your own.

BR,
surya.

krishna wrote:
> Hi,
>
> Iam adding an image in a grid item by using griditem.setImage.
>
> Now i want to change the color of the image with out changing the image.
>
> Iam trying to use gridItem.setForeground but its not working.
>
> Can i dynamically draw the image in the cell.Imean if i want a round
> image can i dynamically draw in the code with out statically placing
> the image..?
>
> or any other suggestions to sove my problem..?
>
>
>
> Thanks in advance
> krishna
>
Re: To change the color of the image in the cell [message #573872 is a reply to message #21749] Thu, 04 January 2007 16:26 Go to previous message
Chris Gross is currently offline Chris Gross
Messages: 471
Registered: July 2009
Senior Member
The Grid will not alter the image for you. You can create your own
image and then set it to the item. For example:

Image image = new Image(display,16,16);
GC gc = new GC(image);
//draw stuff
gc.dispose();
gridItem.setImage(2,image);


-Chris

krishna wrote:
> Hi,
>
> Iam adding an image in a grid item by using griditem.setImage.
>
> Now i want to change the color of the image with out changing the image.
>
> Iam trying to use gridItem.setForeground but its not working.
>
> Can i dynamically draw the image in the cell.Imean if i want a round
> image can i dynamically draw in the code with out statically placing the
> image..?
>
> or any other suggestions to sove my problem..?
>
>
>
> Thanks in advance
> krishna
>
Re: To change the color of the image in the cell [message #578500 is a reply to message #21749] Tue, 13 February 2007 18:03 Go to previous message
Kathiravan  is currently offline Kathiravan
Messages: 33
Registered: July 2009
Member
you have to create the image with the different color on your own.

BR,
surya.

krishna wrote:
> Hi,
>
> Iam adding an image in a grid item by using griditem.setImage.
>
> Now i want to change the color of the image with out changing the image.
>
> Iam trying to use gridItem.setForeground but its not working.
>
> Can i dynamically draw the image in the cell.Imean if i want a round
> image can i dynamically draw in the code with out statically placing
> the image..?
>
> or any other suggestions to sove my problem..?
>
>
>
> Thanks in advance
> krishna
>
Previous Topic:Maximize problem
Next Topic:[CompositeTable] Header and row control construction
Goto Forum:
  


Current Time: Thu Oct 02 14:49:00 GMT 2014

Powered by FUDForum. Page generated in 0.01896 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software