Jump to content
Software FX Community
Sign in to follow this  
User (Legacy)

Palette

Recommended Posts

Dear Olivier:

Palette customization will be one of the many new features part of the next

service pack. However, the bits are ready as far as the customization is

concerned. Please contact support@softwarefx.com for more details on how to

get the HotFixes. Make sure to refer this newsgroup post in your email.

Regards,

--

PR

"Oliver Denzel" <ODE@mik.de> wrote in message

news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

> Hi!

>

> How can I create my own Palette for the Gauges?

>

> Regards

>

> Oliver Denzel

Share this post


Link to post
Share on other sites

Dear Olivier:

Palette customization will be one of the many new features part of the next

service pack. However, the bits are ready as far as the customization is

concerned. Please contact support@softwarefx.com for more details on how to

get the HotFixes. Make sure to refer this newsgroup post in your email.

Regards,

--

PR

"Oliver Denzel" <ODE@mik.de> wrote in message

news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

> Hi!

>

> How can I create my own Palette for the Gauges?

>

> Regards

>

> Oliver Denzel

Share this post


Link to post
Share on other sites

Hi!

I recently got a hotfix, the dlls are from 3rd May 06. Is this new enough?

And how do I customize the palette then?

Regards

Oliver Denzel

Software FX Support wrote:

> Dear Olivier:

>

> Palette customization will be one of the many new features part of the next

> service pack. However, the bits are ready as far as the customization is

> concerned. Please contact support@softwarefx.com for more details on how to

> get the HotFixes. Make sure to refer this newsgroup post in your email.

>

> Regards,

>

> --

> PR

>

>

>

> "Oliver Denzel" <ODE@mik.de> wrote in message

> news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

>

>>Hi!

>>

>>How can I create my own Palette for the Gauges?

>>

>>Regards

>>

>>Oliver Denzel

>

>

>

Share this post


Link to post
Share on other sites

Hi!

I recently got a hotfix, the dlls are from 3rd May 06. Is this new enough?

And how do I customize the palette then?

Regards

Oliver Denzel

Software FX Support wrote:

> Dear Olivier:

>

> Palette customization will be one of the many new features part of the next

> service pack. However, the bits are ready as far as the customization is

> concerned. Please contact support@softwarefx.com for more details on how to

> get the HotFixes. Make sure to refer this newsgroup post in your email.

>

> Regards,

>

> --

> PR

>

>

>

> "Oliver Denzel" <ODE@mik.de> wrote in message

> news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

>

>>Hi!

>>

>>How can I create my own Palette for the Gauges?

>>

>>Regards

>>

>>Oliver Denzel

>

>

>

Share this post


Link to post
Share on other sites

Dear Olivier:

The customization of the Gauges relies on a singleton object called

ResourceLibrary. This object follows a pull model, i.e., it will ask when it

needs to load a custom palette.

1) Subscribe to the PaletteResolve event:

ResourceLibrary.Current.PaletteResolve += new

PaletteResolveHandler(Current_PaletteResolve);

2) Create a custom palette, and assign it to the gauge.

myGauge.Palette = new Palette("MyCustomPalette");

The string identifier of the palette can be anything. However,

myGauge.Palette = new Palette("EarthThones"); is equivalent to

myGauge.Palette = Palette.EarthThones. The "EarthThones" palette is

built-in, and cannot be customized.

3) Implement the event handler. The event handler will only be called once,

because the palette will be cached in a static variable. Therefore, if you

create a new gauge, and assign it to the same palette, the event will not be

raised.

void Current_PaletteResolve(object sender, PaletteResolveEventArgs e) {

if (e.Palette.Name == "MyCustomPalette") {

using (MemoryStream colorStream = new

MemoryStream(PaletteCustomization.Properties.Resources.Custom)) {

using (MemoryStream mappingStream = new

MemoryStream(PaletteCustomization.Properties.Resources.Custom_Mapping)) {

e.LoadPaletteFromStream(colorStream, mappingStream);

}

}

}

}

Similar to ChartFX, a palette is made up of 1) a color collection 2) a color

mapping. In this implementation, I have created a resource called

PaletteCustomization (WinForms VS2005). This resource contains two files:

Custom and Custom_Mapping;

4) Create the palette files. This is an example for Custom:

RGB(0,0,0)

RGB(255,255,255)

RGB(199,199,199)

RGB(224,224,224)

RGB(81,121,214)

RGB(239,47,65)

RGB(255,199,0)

RGB(186,229,92)

RGB(7,186,206)

RGB(168,168,168)

RGB(218, 231, 248); Alt BG

RGB(64,64,64);

RGB(192,150,0);alt start

RGB(140,172,69);

RGB(61,91,161);

RGB(102,102,102);others

RGB(72,38,35)

And for Custom_Mapping:

OutsideBorder, 10

InsideBorder, 1

Indicator, 1

MajorTickmark, 9

MediumTickmark, 9

MinorTickmark, 9

Scale, 3

ScaleBorder, 9

StripBorder, 15

Label, 15

CapColor, 15

NumericalCharacter, 5

Cover, 15

Section1, 6

Section2, 7

Section3, 4

AlternateSection1, 12

AlternateSection2, 13

AlternateSection3, 14

For example, MajorTickmark has a color index of 9. The 9th color in Custom

is RGB(168,168,168).

Be free to post again if you need more information.

"Oliver Denzel" <ODE@mik.de> wrote in message

news:nW1QuMneGHA.1536@webserver3.softwarefx.com...

> Hi!

>

> I recently got a hotfix, the dlls are from 3rd May 06. Is this new enough?

> And how do I customize the palette then?

>

> Regards

>

> Oliver Denzel

>

> Software FX Support wrote:

>> Dear Olivier:

>>

>> Palette customization will be one of the many new features part of the

>> next service pack. However, the bits are ready as far as the

>> customization is concerned. Please contact support@softwarefx.com for

>> more details on how to get the HotFixes. Make sure to refer this

>> newsgroup post in your email.

>>

>> Regards,

>>

>> --

>> PR

>>

>>

>>

>> "Oliver Denzel" <ODE@mik.de> wrote in message

>> news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

>>

>>>Hi!

>>>

>>>How can I create my own Palette for the Gauges?

>>>

>>>Regards

>>>

>>>Oliver Denzel

>>

>>

Share this post


Link to post
Share on other sites

Dear Olivier:

The customization of the Gauges relies on a singleton object called

ResourceLibrary. This object follows a pull model, i.e., it will ask when it

needs to load a custom palette.

1) Subscribe to the PaletteResolve event:

ResourceLibrary.Current.PaletteResolve += new

PaletteResolveHandler(Current_PaletteResolve);

2) Create a custom palette, and assign it to the gauge.

myGauge.Palette = new Palette("MyCustomPalette");

The string identifier of the palette can be anything. However,

myGauge.Palette = new Palette("EarthThones"); is equivalent to

myGauge.Palette = Palette.EarthThones. The "EarthThones" palette is

built-in, and cannot be customized.

3) Implement the event handler. The event handler will only be called once,

because the palette will be cached in a static variable. Therefore, if you

create a new gauge, and assign it to the same palette, the event will not be

raised.

void Current_PaletteResolve(object sender, PaletteResolveEventArgs e) {

if (e.Palette.Name == "MyCustomPalette") {

using (MemoryStream colorStream = new

MemoryStream(PaletteCustomization.Properties.Resources.Custom)) {

using (MemoryStream mappingStream = new

MemoryStream(PaletteCustomization.Properties.Resources.Custom_Mapping)) {

e.LoadPaletteFromStream(colorStream, mappingStream);

}

}

}

}

Similar to ChartFX, a palette is made up of 1) a color collection 2) a color

mapping. In this implementation, I have created a resource called

PaletteCustomization (WinForms VS2005). This resource contains two files:

Custom and Custom_Mapping;

4) Create the palette files. This is an example for Custom:

RGB(0,0,0)

RGB(255,255,255)

RGB(199,199,199)

RGB(224,224,224)

RGB(81,121,214)

RGB(239,47,65)

RGB(255,199,0)

RGB(186,229,92)

RGB(7,186,206)

RGB(168,168,168)

RGB(218, 231, 248); Alt BG

RGB(64,64,64);

RGB(192,150,0);alt start

RGB(140,172,69);

RGB(61,91,161);

RGB(102,102,102);others

RGB(72,38,35)

And for Custom_Mapping:

OutsideBorder, 10

InsideBorder, 1

Indicator, 1

MajorTickmark, 9

MediumTickmark, 9

MinorTickmark, 9

Scale, 3

ScaleBorder, 9

StripBorder, 15

Label, 15

CapColor, 15

NumericalCharacter, 5

Cover, 15

Section1, 6

Section2, 7

Section3, 4

AlternateSection1, 12

AlternateSection2, 13

AlternateSection3, 14

For example, MajorTickmark has a color index of 9. The 9th color in Custom

is RGB(168,168,168).

Be free to post again if you need more information.

"Oliver Denzel" <ODE@mik.de> wrote in message

news:nW1QuMneGHA.1536@webserver3.softwarefx.com...

> Hi!

>

> I recently got a hotfix, the dlls are from 3rd May 06. Is this new enough?

> And how do I customize the palette then?

>

> Regards

>

> Oliver Denzel

>

> Software FX Support wrote:

>> Dear Olivier:

>>

>> Palette customization will be one of the many new features part of the

>> next service pack. However, the bits are ready as far as the

>> customization is concerned. Please contact support@softwarefx.com for

>> more details on how to get the HotFixes. Make sure to refer this

>> newsgroup post in your email.

>>

>> Regards,

>>

>> --

>> PR

>>

>>

>>

>> "Oliver Denzel" <ODE@mik.de> wrote in message

>> news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

>>

>>>Hi!

>>>

>>>How can I create my own Palette for the Gauges?

>>>

>>>Regards

>>>

>>>Oliver Denzel

>>

>>

Share this post


Link to post
Share on other sites

Hi!

I implemented your suggestion, with a change: I read the palette from

files. Therefore my code looks like this:

private void Current_PaletteResolve(object sender,

ChartFX.WinForms.Gauge.Customization.PaletteResolveEventArgs e)

{

if (e.Palette.Name.StartsWith("MIK"))

{

try

{

using (FileStream colorStream = new FileStream("C:\\custom.txt",

FileMode.Open))

{

using (FileStream mappingStream = new

FileStream("C:\\custom_mapping.txt", FileMode.Open))

{

e.LoadPaletteFromStream(colorStream, mappingStream);

}

}

}

catch (Exception ex)

{

log.Info("Exception on loading palette: ", ex);

}

}

}

The code executes without an exception, but afterwards there is an

exception, that the palette MIK-Test (which I defined) is not resolved.

Regards

Oliver Denzel

Software FX Support wrote:

> Dear Olivier:

>

>

> The customization of the Gauges relies on a singleton object called

> ResourceLibrary. This object follows a pull model, i.e., it will ask when it

> needs to load a custom palette.

>

> 1) Subscribe to the PaletteResolve event:

> ResourceLibrary.Current.PaletteResolve += new

> PaletteResolveHandler(Current_PaletteResolve);

>

> 2) Create a custom palette, and assign it to the gauge.

> myGauge.Palette = new Palette("MyCustomPalette");

>

> The string identifier of the palette can be anything. However,

> myGauge.Palette = new Palette("EarthThones"); is equivalent to

> myGauge.Palette = Palette.EarthThones. The "EarthThones" palette is

> built-in, and cannot be customized.

>

> 3) Implement the event handler. The event handler will only be called once,

> because the palette will be cached in a static variable. Therefore, if you

> create a new gauge, and assign it to the same palette, the event will not be

> raised.

> void Current_PaletteResolve(object sender, PaletteResolveEventArgs e) {

> if (e.Palette.Name == "MyCustomPalette") {

> using (MemoryStream colorStream = new

> MemoryStream(PaletteCustomization.Properties.Resources.Custom)) {

> using (MemoryStream mappingStream = new

> MemoryStream(PaletteCustomization.Properties.Resources.Custom_Mapping)) {

> e.LoadPaletteFromStream(colorStream, mappingStream);

> }

> }

> }

> }

>

> Similar to ChartFX, a palette is made up of 1) a color collection 2) a color

> mapping. In this implementation, I have created a resource called

> PaletteCustomization (WinForms VS2005). This resource contains two files:

> Custom and Custom_Mapping;

>

> 4) Create the palette files. This is an example for Custom:

>

> RGB(0,0,0)

> RGB(255,255,255)

> RGB(199,199,199)

> RGB(224,224,224)

> RGB(81,121,214)

> RGB(239,47,65)

> RGB(255,199,0)

> RGB(186,229,92)

> RGB(7,186,206)

> RGB(168,168,168)

> RGB(218, 231, 248); Alt BG

> RGB(64,64,64);

> RGB(192,150,0);alt start

> RGB(140,172,69);

> RGB(61,91,161);

> RGB(102,102,102);others

> RGB(72,38,35)

>

> And for Custom_Mapping:

> OutsideBorder, 10

> InsideBorder, 1

> Indicator, 1

> MajorTickmark, 9

> MediumTickmark, 9

> MinorTickmark, 9

> Scale, 3

> ScaleBorder, 9

> StripBorder, 15

> Label, 15

> CapColor, 15

> NumericalCharacter, 5

> Cover, 15

> Section1, 6

> Section2, 7

> Section3, 4

> AlternateSection1, 12

> AlternateSection2, 13

> AlternateSection3, 14

>

> For example, MajorTickmark has a color index of 9. The 9th color in Custom

> is RGB(168,168,168).

>

>

> Be free to post again if you need more information.

>

>

> "Oliver Denzel" <ODE@mik.de> wrote in message

> news:nW1QuMneGHA.1536@webserver3.softwarefx.com...

>

>>Hi!

>>

>>I recently got a hotfix, the dlls are from 3rd May 06. Is this new enough?

>>And how do I customize the palette then?

>>

>>Regards

>>

>>Oliver Denzel

>>

>>Software FX Support wrote:

>>

>>>Dear Olivier:

>>>

>>>Palette customization will be one of the many new features part of the

>>>next service pack. However, the bits are ready as far as the

>>>customization is concerned. Please contact support@softwarefx.com for

>>>more details on how to get the HotFixes. Make sure to refer this

>>>newsgroup post in your email.

>>>

>>>Regards,

>>>

>>>--

>>>PR

>>>

>>>

>>>

>>>"Oliver Denzel" <ODE@mik.de> wrote in message

>>>news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

>>>

>>>

>>>>Hi!

>>>>

>>>>How can I create my own Palette for the Gauges?

>>>>

>>>>Regards

>>>>

>>>>Oliver Denzel

>>>

>>>

>

Share this post


Link to post
Share on other sites

Hi!

I implemented your suggestion, with a change: I read the palette from

files. Therefore my code looks like this:

private void Current_PaletteResolve(object sender,

ChartFX.WinForms.Gauge.Customization.PaletteResolveEventArgs e)

{

if (e.Palette.Name.StartsWith("MIK"))

{

try

{

using (FileStream colorStream = new FileStream("C:\\custom.txt",

FileMode.Open))

{

using (FileStream mappingStream = new

FileStream("C:\\custom_mapping.txt", FileMode.Open))

{

e.LoadPaletteFromStream(colorStream, mappingStream);

}

}

}

catch (Exception ex)

{

log.Info("Exception on loading palette: ", ex);

}

}

}

The code executes without an exception, but afterwards there is an

exception, that the palette MIK-Test (which I defined) is not resolved.

Regards

Oliver Denzel

Software FX Support wrote:

> Dear Olivier:

>

>

> The customization of the Gauges relies on a singleton object called

> ResourceLibrary. This object follows a pull model, i.e., it will ask when it

> needs to load a custom palette.

>

> 1) Subscribe to the PaletteResolve event:

> ResourceLibrary.Current.PaletteResolve += new

> PaletteResolveHandler(Current_PaletteResolve);

>

> 2) Create a custom palette, and assign it to the gauge.

> myGauge.Palette = new Palette("MyCustomPalette");

>

> The string identifier of the palette can be anything. However,

> myGauge.Palette = new Palette("EarthThones"); is equivalent to

> myGauge.Palette = Palette.EarthThones. The "EarthThones" palette is

> built-in, and cannot be customized.

>

> 3) Implement the event handler. The event handler will only be called once,

> because the palette will be cached in a static variable. Therefore, if you

> create a new gauge, and assign it to the same palette, the event will not be

> raised.

> void Current_PaletteResolve(object sender, PaletteResolveEventArgs e) {

> if (e.Palette.Name == "MyCustomPalette") {

> using (MemoryStream colorStream = new

> MemoryStream(PaletteCustomization.Properties.Resources.Custom)) {

> using (MemoryStream mappingStream = new

> MemoryStream(PaletteCustomization.Properties.Resources.Custom_Mapping)) {

> e.LoadPaletteFromStream(colorStream, mappingStream);

> }

> }

> }

> }

>

> Similar to ChartFX, a palette is made up of 1) a color collection 2) a color

> mapping. In this implementation, I have created a resource called

> PaletteCustomization (WinForms VS2005). This resource contains two files:

> Custom and Custom_Mapping;

>

> 4) Create the palette files. This is an example for Custom:

>

> RGB(0,0,0)

> RGB(255,255,255)

> RGB(199,199,199)

> RGB(224,224,224)

> RGB(81,121,214)

> RGB(239,47,65)

> RGB(255,199,0)

> RGB(186,229,92)

> RGB(7,186,206)

> RGB(168,168,168)

> RGB(218, 231, 248); Alt BG

> RGB(64,64,64);

> RGB(192,150,0);alt start

> RGB(140,172,69);

> RGB(61,91,161);

> RGB(102,102,102);others

> RGB(72,38,35)

>

> And for Custom_Mapping:

> OutsideBorder, 10

> InsideBorder, 1

> Indicator, 1

> MajorTickmark, 9

> MediumTickmark, 9

> MinorTickmark, 9

> Scale, 3

> ScaleBorder, 9

> StripBorder, 15

> Label, 15

> CapColor, 15

> NumericalCharacter, 5

> Cover, 15

> Section1, 6

> Section2, 7

> Section3, 4

> AlternateSection1, 12

> AlternateSection2, 13

> AlternateSection3, 14

>

> For example, MajorTickmark has a color index of 9. The 9th color in Custom

> is RGB(168,168,168).

>

>

> Be free to post again if you need more information.

>

>

> "Oliver Denzel" <ODE@mik.de> wrote in message

> news:nW1QuMneGHA.1536@webserver3.softwarefx.com...

>

>>Hi!

>>

>>I recently got a hotfix, the dlls are from 3rd May 06. Is this new enough?

>>And how do I customize the palette then?

>>

>>Regards

>>

>>Oliver Denzel

>>

>>Software FX Support wrote:

>>

>>>Dear Olivier:

>>>

>>>Palette customization will be one of the many new features part of the

>>>next service pack. However, the bits are ready as far as the

>>>customization is concerned. Please contact support@softwarefx.com for

>>>more details on how to get the HotFixes. Make sure to refer this

>>>newsgroup post in your email.

>>>

>>>Regards,

>>>

>>>--

>>>PR

>>>

>>>

>>>

>>>"Oliver Denzel" <ODE@mik.de> wrote in message

>>>news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

>>>

>>>

>>>>Hi!

>>>>

>>>>How can I create my own Palette for the Gauges?

>>>>

>>>>Regards

>>>>

>>>>Oliver Denzel

>>>

>>>

>

Share this post


Link to post
Share on other sites

Dear Olivier:

Do you subscribe to the event before rendering the gauge? Is your event

handler being called? If so, what is the value of e.Palette.Name?

Regards,

--

PR

"Oliver Denzel" <ODE@mik.de> wrote in message

news:pxd$T6oeGHA.3992@webserver3.softwarefx.com...

> Hi!

>

> I implemented your suggestion, with a change: I read the palette from

> files. Therefore my code looks like this:

>

> private void Current_PaletteResolve(object sender,

> ChartFX.WinForms.Gauge.Customization.PaletteResolveEventArgs e)

> {

> if (e.Palette.Name.StartsWith("MIK"))

> {

> try

> {

> using (FileStream colorStream = new FileStream("C:\\custom.txt",

> FileMode.Open))

> {

> using (FileStream mappingStream = new FileStream("C:\\custom_mapping.txt",

> FileMode.Open))

> {

> e.LoadPaletteFromStream(colorStream, mappingStream);

> }

> }

> }

> catch (Exception ex)

> {

> log.Info("Exception on loading palette: ", ex);

> }

> }

> }

> The code executes without an exception, but afterwards there is an

> exception, that the palette MIK-Test (which I defined) is not resolved.

>

> Regards

>

> Oliver Denzel

>

> Software FX Support wrote:

>> Dear Olivier:

>>

>>

>> The customization of the Gauges relies on a singleton object called

>> ResourceLibrary. This object follows a pull model, i.e., it will ask when

>> it needs to load a custom palette.

>>

>> 1) Subscribe to the PaletteResolve event:

>> ResourceLibrary.Current.PaletteResolve += new

>> PaletteResolveHandler(Current_PaletteResolve);

>>

>> 2) Create a custom palette, and assign it to the gauge.

>> myGauge.Palette = new Palette("MyCustomPalette");

>>

>> The string identifier of the palette can be anything. However,

>> myGauge.Palette = new Palette("EarthThones"); is equivalent to

>> myGauge.Palette = Palette.EarthThones. The "EarthThones" palette is

>> built-in, and cannot be customized.

>>

>> 3) Implement the event handler. The event handler will only be called

>> once, because the palette will be cached in a static variable. Therefore,

>> if you create a new gauge, and assign it to the same palette, the event

>> will not be raised.

>> void Current_PaletteResolve(object sender, PaletteResolveEventArgs e) {

>> if (e.Palette.Name == "MyCustomPalette") {

>> using (MemoryStream colorStream = new

>> MemoryStream(PaletteCustomization.Properties.Resources.Custom)) {

>> using (MemoryStream mappingStream = new

>> MemoryStream(PaletteCustomization.Properties.Resources.Custom_Mapping)) {

>> e.LoadPaletteFromStream(colorStream, mappingStream);

>> }

>> }

>> }

>> }

>>

>> Similar to ChartFX, a palette is made up of 1) a color collection 2) a

>> color mapping. In this implementation, I have created a resource called

>> PaletteCustomization (WinForms VS2005). This resource contains two files:

>> Custom and Custom_Mapping;

>>

>> 4) Create the palette files. This is an example for Custom:

>>

>> RGB(0,0,0)

>> RGB(255,255,255)

>> RGB(199,199,199)

>> RGB(224,224,224)

>> RGB(81,121,214)

>> RGB(239,47,65)

>> RGB(255,199,0)

>> RGB(186,229,92)

>> RGB(7,186,206)

>> RGB(168,168,168)

>> RGB(218, 231, 248); Alt BG

>> RGB(64,64,64);

>> RGB(192,150,0);alt start

>> RGB(140,172,69);

>> RGB(61,91,161);

>> RGB(102,102,102);others

>> RGB(72,38,35)

>>

>> And for Custom_Mapping:

>> OutsideBorder, 10

>> InsideBorder, 1

>> Indicator, 1

>> MajorTickmark, 9

>> MediumTickmark, 9

>> MinorTickmark, 9

>> Scale, 3

>> ScaleBorder, 9

>> StripBorder, 15

>> Label, 15

>> CapColor, 15

>> NumericalCharacter, 5

>> Cover, 15

>> Section1, 6

>> Section2, 7

>> Section3, 4

>> AlternateSection1, 12

>> AlternateSection2, 13

>> AlternateSection3, 14

>>

>> For example, MajorTickmark has a color index of 9. The 9th color in

>> Custom is RGB(168,168,168).

>>

>>

>> Be free to post again if you need more information.

>>

>>

>> "Oliver Denzel" <ODE@mik.de> wrote in message

>> news:nW1QuMneGHA.1536@webserver3.softwarefx.com...

>>

>>>Hi!

>>>

>>>I recently got a hotfix, the dlls are from 3rd May 06. Is this new

>>>enough?

>>>And how do I customize the palette then?

>>>

>>>Regards

>>>

>>>Oliver Denzel

>>>

>>>Software FX Support wrote:

>>>

>>>>Dear Olivier:

>>>>

>>>>Palette customization will be one of the many new features part of the

>>>>next service pack. However, the bits are ready as far as the

>>>>customization is concerned. Please contact support@softwarefx.com for

>>>>more details on how to get the HotFixes. Make sure to refer this

>>>>newsgroup post in your email.

>>>>

>>>>Regards,

>>>>

>>>>--

>>>>PR

>>>>

>>>>

>>>>

>>>>"Oliver Denzel" <ODE@mik.de> wrote in message

>>>>news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

>>>>

>>>>

>>>>>Hi!

>>>>>

>>>>>How can I create my own Palette for the Gauges?

>>>>>

>>>>>Regards

>>>>>

>>>>>Oliver Denzel

>>>>

>>>>

>>

Share this post


Link to post
Share on other sites

Dear Olivier:

Do you subscribe to the event before rendering the gauge? Is your event

handler being called? If so, what is the value of e.Palette.Name?

Regards,

--

PR

"Oliver Denzel" <ODE@mik.de> wrote in message

news:pxd$T6oeGHA.3992@webserver3.softwarefx.com...

> Hi!

>

> I implemented your suggestion, with a change: I read the palette from

> files. Therefore my code looks like this:

>

> private void Current_PaletteResolve(object sender,

> ChartFX.WinForms.Gauge.Customization.PaletteResolveEventArgs e)

> {

> if (e.Palette.Name.StartsWith("MIK"))

> {

> try

> {

> using (FileStream colorStream = new FileStream("C:\\custom.txt",

> FileMode.Open))

> {

> using (FileStream mappingStream = new FileStream("C:\\custom_mapping.txt",

> FileMode.Open))

> {

> e.LoadPaletteFromStream(colorStream, mappingStream);

> }

> }

> }

> catch (Exception ex)

> {

> log.Info("Exception on loading palette: ", ex);

> }

> }

> }

> The code executes without an exception, but afterwards there is an

> exception, that the palette MIK-Test (which I defined) is not resolved.

>

> Regards

>

> Oliver Denzel

>

> Software FX Support wrote:

>> Dear Olivier:

>>

>>

>> The customization of the Gauges relies on a singleton object called

>> ResourceLibrary. This object follows a pull model, i.e., it will ask when

>> it needs to load a custom palette.

>>

>> 1) Subscribe to the PaletteResolve event:

>> ResourceLibrary.Current.PaletteResolve += new

>> PaletteResolveHandler(Current_PaletteResolve);

>>

>> 2) Create a custom palette, and assign it to the gauge.

>> myGauge.Palette = new Palette("MyCustomPalette");

>>

>> The string identifier of the palette can be anything. However,

>> myGauge.Palette = new Palette("EarthThones"); is equivalent to

>> myGauge.Palette = Palette.EarthThones. The "EarthThones" palette is

>> built-in, and cannot be customized.

>>

>> 3) Implement the event handler. The event handler will only be called

>> once, because the palette will be cached in a static variable. Therefore,

>> if you create a new gauge, and assign it to the same palette, the event

>> will not be raised.

>> void Current_PaletteResolve(object sender, PaletteResolveEventArgs e) {

>> if (e.Palette.Name == "MyCustomPalette") {

>> using (MemoryStream colorStream = new

>> MemoryStream(PaletteCustomization.Properties.Resources.Custom)) {

>> using (MemoryStream mappingStream = new

>> MemoryStream(PaletteCustomization.Properties.Resources.Custom_Mapping)) {

>> e.LoadPaletteFromStream(colorStream, mappingStream);

>> }

>> }

>> }

>> }

>>

>> Similar to ChartFX, a palette is made up of 1) a color collection 2) a

>> color mapping. In this implementation, I have created a resource called

>> PaletteCustomization (WinForms VS2005). This resource contains two files:

>> Custom and Custom_Mapping;

>>

>> 4) Create the palette files. This is an example for Custom:

>>

>> RGB(0,0,0)

>> RGB(255,255,255)

>> RGB(199,199,199)

>> RGB(224,224,224)

>> RGB(81,121,214)

>> RGB(239,47,65)

>> RGB(255,199,0)

>> RGB(186,229,92)

>> RGB(7,186,206)

>> RGB(168,168,168)

>> RGB(218, 231, 248); Alt BG

>> RGB(64,64,64);

>> RGB(192,150,0);alt start

>> RGB(140,172,69);

>> RGB(61,91,161);

>> RGB(102,102,102);others

>> RGB(72,38,35)

>>

>> And for Custom_Mapping:

>> OutsideBorder, 10

>> InsideBorder, 1

>> Indicator, 1

>> MajorTickmark, 9

>> MediumTickmark, 9

>> MinorTickmark, 9

>> Scale, 3

>> ScaleBorder, 9

>> StripBorder, 15

>> Label, 15

>> CapColor, 15

>> NumericalCharacter, 5

>> Cover, 15

>> Section1, 6

>> Section2, 7

>> Section3, 4

>> AlternateSection1, 12

>> AlternateSection2, 13

>> AlternateSection3, 14

>>

>> For example, MajorTickmark has a color index of 9. The 9th color in

>> Custom is RGB(168,168,168).

>>

>>

>> Be free to post again if you need more information.

>>

>>

>> "Oliver Denzel" <ODE@mik.de> wrote in message

>> news:nW1QuMneGHA.1536@webserver3.softwarefx.com...

>>

>>>Hi!

>>>

>>>I recently got a hotfix, the dlls are from 3rd May 06. Is this new

>>>enough?

>>>And how do I customize the palette then?

>>>

>>>Regards

>>>

>>>Oliver Denzel

>>>

>>>Software FX Support wrote:

>>>

>>>>Dear Olivier:

>>>>

>>>>Palette customization will be one of the many new features part of the

>>>>next service pack. However, the bits are ready as far as the

>>>>customization is concerned. Please contact support@softwarefx.com for

>>>>more details on how to get the HotFixes. Make sure to refer this

>>>>newsgroup post in your email.

>>>>

>>>>Regards,

>>>>

>>>>--

>>>>PR

>>>>

>>>>

>>>>

>>>>"Oliver Denzel" <ODE@mik.de> wrote in message

>>>>news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

>>>>

>>>>

>>>>>Hi!

>>>>>

>>>>>How can I create my own Palette for the Gauges?

>>>>>

>>>>>Regards

>>>>>

>>>>>Oliver Denzel

>>>>

>>>>

>>

Share this post


Link to post
Share on other sites

Hi!

Yes, the code in the eventhandler gets executed, and the name of the

Palette is MIK-Test as I specified. So the code in the if clause also

gets executed.

Any other hints?

Regards

Oliver Denzel

Software FX Support wrote:

> Dear Olivier:

>

> Do you subscribe to the event before rendering the gauge? Is your event

> handler being called? If so, what is the value of e.Palette.Name?

>

> Regards,

>

> --

> PR

>

>

> "Oliver Denzel" <ODE@mik.de> wrote in message

> news:pxd$T6oeGHA.3992@webserver3.softwarefx.com...

>

>>Hi!

>>

>>I implemented your suggestion, with a change: I read the palette from

>>files. Therefore my code looks like this:

>>

>>private void Current_PaletteResolve(object sender,

>>ChartFX.WinForms.Gauge.Customization.PaletteResolveEventArgs e)

>>{

>>if (e.Palette.Name.StartsWith("MIK"))

>>{

>>try

>>{

>>using (FileStream colorStream = new FileStream("C:\\custom.txt",

>>FileMode.Open))

>>{

>>using (FileStream mappingStream = new FileStream("C:\\custom_mapping.txt",

>>FileMode.Open))

>>{

>>e.LoadPaletteFromStream(colorStream, mappingStream);

>>}

>>}

>>}

>>catch (Exception ex)

>>{

>>log.Info("Exception on loading palette: ", ex);

>>}

>>}

>>}

>>The code executes without an exception, but afterwards there is an

>>exception, that the palette MIK-Test (which I defined) is not resolved.

>>

>>Regards

>>

>>Oliver Denzel

>>

>>Software FX Support wrote:

>>

>>>Dear Olivier:

>>>

>>>

>>>The customization of the Gauges relies on a singleton object called

>>>ResourceLibrary. This object follows a pull model, i.e., it will ask when

>>>it needs to load a custom palette.

>>>

>>>1) Subscribe to the PaletteResolve event:

>>> ResourceLibrary.Current.PaletteResolve += new

>>>PaletteResolveHandler(Current_PaletteResolve);

>>>

>>>2) Create a custom palette, and assign it to the gauge.

>>>myGauge.Palette = new Palette("MyCustomPalette");

>>>

>>>The string identifier of the palette can be anything. However,

>>>myGauge.Palette = new Palette("EarthThones"); is equivalent to

>>>myGauge.Palette = Palette.EarthThones. The "EarthThones" palette is

>>>built-in, and cannot be customized.

>>>

>>>3) Implement the event handler. The event handler will only be called

>>>once, because the palette will be cached in a static variable. Therefore,

>>>if you create a new gauge, and assign it to the same palette, the event

>>>will not be raised.

>>> void Current_PaletteResolve(object sender, PaletteResolveEventArgs e) {

>>> if (e.Palette.Name == "MyCustomPalette") {

>>> using (MemoryStream colorStream = new

>>>MemoryStream(PaletteCustomization.Properties.Resources.Custom)) {

>>> using (MemoryStream mappingStream = new

>>>MemoryStream(PaletteCustomization.Properties.Resources.Custom_Mapping)) {

>>> e.LoadPaletteFromStream(colorStream, mappingStream);

>>> }

>>> }

>>> }

>>> }

>>>

>>>Similar to ChartFX, a palette is made up of 1) a color collection 2) a

>>>color mapping. In this implementation, I have created a resource called

>>>PaletteCustomization (WinForms VS2005). This resource contains two files:

>>>Custom and Custom_Mapping;

>>>

>>>4) Create the palette files. This is an example for Custom:

>>>

>>>RGB(0,0,0)

>>>RGB(255,255,255)

>>>RGB(199,199,199)

>>>RGB(224,224,224)

>>>RGB(81,121,214)

>>>RGB(239,47,65)

>>>RGB(255,199,0)

>>>RGB(186,229,92)

>>>RGB(7,186,206)

>>>RGB(168,168,168)

>>>RGB(218, 231, 248); Alt BG

>>>RGB(64,64,64);

>>>RGB(192,150,0);alt start

>>>RGB(140,172,69);

>>>RGB(61,91,161);

>>>RGB(102,102,102);others

>>>RGB(72,38,35)

>>>

>>>And for Custom_Mapping:

>>>OutsideBorder, 10

>>>InsideBorder, 1

>>>Indicator, 1

>>>MajorTickmark, 9

>>>MediumTickmark, 9

>>>MinorTickmark, 9

>>>Scale, 3

>>>ScaleBorder, 9

>>>StripBorder, 15

>>>Label, 15

>>>CapColor, 15

>>>NumericalCharacter, 5

>>>Cover, 15

>>>Section1, 6

>>>Section2, 7

>>>Section3, 4

>>>AlternateSection1, 12

>>>AlternateSection2, 13

>>>AlternateSection3, 14

>>>

>>>For example, MajorTickmark has a color index of 9. The 9th color in

>>>Custom is RGB(168,168,168).

>>>

>>>

>>>Be free to post again if you need more information.

>>>

>>>

>>>"Oliver Denzel" <ODE@mik.de> wrote in message

>>>news:nW1QuMneGHA.1536@webserver3.softwarefx.com...

>>>

>>>

>>>>Hi!

>>>>

>>>>I recently got a hotfix, the dlls are from 3rd May 06. Is this new

>>>>enough?

>>>>And how do I customize the palette then?

>>>>

>>>>Regards

>>>>

>>>>Oliver Denzel

>>>>

>>>>Software FX Support wrote:

>>>>

>>>>

>>>>>Dear Olivier:

>>>>>

>>>>>Palette customization will be one of the many new features part of the

>>>>>next service pack. However, the bits are ready as far as the

>>>>>customization is concerned. Please contact support@softwarefx.com for

>>>>>more details on how to get the HotFixes. Make sure to refer this

>>>>>newsgroup post in your email.

>>>>>

>>>>>Regards,

>>>>>

>>>>>--

>>>>>PR

>>>>>

>>>>>

>>>>>

>>>>>"Oliver Denzel" <ODE@mik.de> wrote in message

>>>>>news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

>>>>>

>>>>>

>>>>>

>>>>>>Hi!

>>>>>>

>>>>>>How can I create my own Palette for the Gauges?

>>>>>>

>>>>>>Regards

>>>>>>

>>>>>>Oliver Denzel

>>>>>

>>>>>

>

>

Share this post


Link to post
Share on other sites

Hi!

Yes, the code in the eventhandler gets executed, and the name of the

Palette is MIK-Test as I specified. So the code in the if clause also

gets executed.

Any other hints?

Regards

Oliver Denzel

Software FX Support wrote:

> Dear Olivier:

>

> Do you subscribe to the event before rendering the gauge? Is your event

> handler being called? If so, what is the value of e.Palette.Name?

>

> Regards,

>

> --

> PR

>

>

> "Oliver Denzel" <ODE@mik.de> wrote in message

> news:pxd$T6oeGHA.3992@webserver3.softwarefx.com...

>

>>Hi!

>>

>>I implemented your suggestion, with a change: I read the palette from

>>files. Therefore my code looks like this:

>>

>>private void Current_PaletteResolve(object sender,

>>ChartFX.WinForms.Gauge.Customization.PaletteResolveEventArgs e)

>>{

>>if (e.Palette.Name.StartsWith("MIK"))

>>{

>>try

>>{

>>using (FileStream colorStream = new FileStream("C:\\custom.txt",

>>FileMode.Open))

>>{

>>using (FileStream mappingStream = new FileStream("C:\\custom_mapping.txt",

>>FileMode.Open))

>>{

>>e.LoadPaletteFromStream(colorStream, mappingStream);

>>}

>>}

>>}

>>catch (Exception ex)

>>{

>>log.Info("Exception on loading palette: ", ex);

>>}

>>}

>>}

>>The code executes without an exception, but afterwards there is an

>>exception, that the palette MIK-Test (which I defined) is not resolved.

>>

>>Regards

>>

>>Oliver Denzel

>>

>>Software FX Support wrote:

>>

>>>Dear Olivier:

>>>

>>>

>>>The customization of the Gauges relies on a singleton object called

>>>ResourceLibrary. This object follows a pull model, i.e., it will ask when

>>>it needs to load a custom palette.

>>>

>>>1) Subscribe to the PaletteResolve event:

>>> ResourceLibrary.Current.PaletteResolve += new

>>>PaletteResolveHandler(Current_PaletteResolve);

>>>

>>>2) Create a custom palette, and assign it to the gauge.

>>>myGauge.Palette = new Palette("MyCustomPalette");

>>>

>>>The string identifier of the palette can be anything. However,

>>>myGauge.Palette = new Palette("EarthThones"); is equivalent to

>>>myGauge.Palette = Palette.EarthThones. The "EarthThones" palette is

>>>built-in, and cannot be customized.

>>>

>>>3) Implement the event handler. The event handler will only be called

>>>once, because the palette will be cached in a static variable. Therefore,

>>>if you create a new gauge, and assign it to the same palette, the event

>>>will not be raised.

>>> void Current_PaletteResolve(object sender, PaletteResolveEventArgs e) {

>>> if (e.Palette.Name == "MyCustomPalette") {

>>> using (MemoryStream colorStream = new

>>>MemoryStream(PaletteCustomization.Properties.Resources.Custom)) {

>>> using (MemoryStream mappingStream = new

>>>MemoryStream(PaletteCustomization.Properties.Resources.Custom_Mapping)) {

>>> e.LoadPaletteFromStream(colorStream, mappingStream);

>>> }

>>> }

>>> }

>>> }

>>>

>>>Similar to ChartFX, a palette is made up of 1) a color collection 2) a

>>>color mapping. In this implementation, I have created a resource called

>>>PaletteCustomization (WinForms VS2005). This resource contains two files:

>>>Custom and Custom_Mapping;

>>>

>>>4) Create the palette files. This is an example for Custom:

>>>

>>>RGB(0,0,0)

>>>RGB(255,255,255)

>>>RGB(199,199,199)

>>>RGB(224,224,224)

>>>RGB(81,121,214)

>>>RGB(239,47,65)

>>>RGB(255,199,0)

>>>RGB(186,229,92)

>>>RGB(7,186,206)

>>>RGB(168,168,168)

>>>RGB(218, 231, 248); Alt BG

>>>RGB(64,64,64);

>>>RGB(192,150,0);alt start

>>>RGB(140,172,69);

>>>RGB(61,91,161);

>>>RGB(102,102,102);others

>>>RGB(72,38,35)

>>>

>>>And for Custom_Mapping:

>>>OutsideBorder, 10

>>>InsideBorder, 1

>>>Indicator, 1

>>>MajorTickmark, 9

>>>MediumTickmark, 9

>>>MinorTickmark, 9

>>>Scale, 3

>>>ScaleBorder, 9

>>>StripBorder, 15

>>>Label, 15

>>>CapColor, 15

>>>NumericalCharacter, 5

>>>Cover, 15

>>>Section1, 6

>>>Section2, 7

>>>Section3, 4

>>>AlternateSection1, 12

>>>AlternateSection2, 13

>>>AlternateSection3, 14

>>>

>>>For example, MajorTickmark has a color index of 9. The 9th color in

>>>Custom is RGB(168,168,168).

>>>

>>>

>>>Be free to post again if you need more information.

>>>

>>>

>>>"Oliver Denzel" <ODE@mik.de> wrote in message

>>>news:nW1QuMneGHA.1536@webserver3.softwarefx.com...

>>>

>>>

>>>>Hi!

>>>>

>>>>I recently got a hotfix, the dlls are from 3rd May 06. Is this new

>>>>enough?

>>>>And how do I customize the palette then?

>>>>

>>>>Regards

>>>>

>>>>Oliver Denzel

>>>>

>>>>Software FX Support wrote:

>>>>

>>>>

>>>>>Dear Olivier:

>>>>>

>>>>>Palette customization will be one of the many new features part of the

>>>>>next service pack. However, the bits are ready as far as the

>>>>>customization is concerned. Please contact support@softwarefx.com for

>>>>>more details on how to get the HotFixes. Make sure to refer this

>>>>>newsgroup post in your email.

>>>>>

>>>>>Regards,

>>>>>

>>>>>--

>>>>>PR

>>>>>

>>>>>

>>>>>

>>>>>"Oliver Denzel" <ODE@mik.de> wrote in message

>>>>>news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

>>>>>

>>>>>

>>>>>

>>>>>>Hi!

>>>>>>

>>>>>>How can I create my own Palette for the Gauges?

>>>>>>

>>>>>>Regards

>>>>>>

>>>>>>Oliver Denzel

>>>>>

>>>>>

>

>

Share this post


Link to post
Share on other sites

Dear Olivier:

Please contact Support to get the latest hotfix for Gauges, as I have just

fixed the problem. BTW, we are really close to release a full-feature

service pack in the coming days. The service pack will contain in-depth

documentation on how to customize the gauge.

Regards,

--

PR

"Oliver Denzel" <ODE@mik.de> wrote in message

news:bz8CF%23jfGHA.1536@webserver3.softwarefx.com...

> Hi!

>

> Yes, the code in the eventhandler gets executed, and the name of the

> Palette is MIK-Test as I specified. So the code in the if clause also gets

> executed.

>

> Any other hints?

>

> Regards

>

> Oliver Denzel

>

> Software FX Support wrote:

>> Dear Olivier:

>>

>> Do you subscribe to the event before rendering the gauge? Is your event

>> handler being called? If so, what is the value of e.Palette.Name?

>>

>> Regards,

>>

>> --

>> PR

>>

>>

>> "Oliver Denzel" <ODE@mik.de> wrote in message

>> news:pxd$T6oeGHA.3992@webserver3.softwarefx.com...

>>

>>>Hi!

>>>

>>>I implemented your suggestion, with a change: I read the palette from

>>>files. Therefore my code looks like this:

>>>

>>>private void Current_PaletteResolve(object sender,

>>>ChartFX.WinForms.Gauge.Customization.PaletteResolveEventArgs e)

>>>{

>>>if (e.Palette.Name.StartsWith("MIK"))

>>>{

>>>try

>>>{

>>>using (FileStream colorStream = new FileStream("C:\\custom.txt",

>>>FileMode.Open))

>>>{

>>>using (FileStream mappingStream = new

>>>FileStream("C:\\custom_mapping.txt", FileMode.Open))

>>>{

>>>e.LoadPaletteFromStream(colorStream, mappingStream);

>>>}

>>>}

>>>}

>>>catch (Exception ex)

>>>{

>>>log.Info("Exception on loading palette: ", ex);

>>>}

>>>}

>>>}

>>>The code executes without an exception, but afterwards there is an

>>>exception, that the palette MIK-Test (which I defined) is not resolved.

>>>

>>>Regards

>>>

>>>Oliver Denzel

>>>

>>>Software FX Support wrote:

>>>

>>>>Dear Olivier:

>>>>

>>>>

>>>>The customization of the Gauges relies on a singleton object called

>>>>ResourceLibrary. This object follows a pull model, i.e., it will ask

>>>>when it needs to load a custom palette.

>>>>

>>>>1) Subscribe to the PaletteResolve event:

>>>> ResourceLibrary.Current.PaletteResolve += new

>>>> PaletteResolveHandler(Current_PaletteResolve);

>>>>

>>>>2) Create a custom palette, and assign it to the gauge.

>>>>myGauge.Palette = new Palette("MyCustomPalette");

>>>>

>>>>The string identifier of the palette can be anything. However,

>>>>myGauge.Palette = new Palette("EarthThones"); is equivalent to

>>>>myGauge.Palette = Palette.EarthThones. The "EarthThones" palette is

>>>>built-in, and cannot be customized.

>>>>

>>>>3) Implement the event handler. The event handler will only be called

>>>>once, because the palette will be cached in a static variable.

>>>>Therefore, if you create a new gauge, and assign it to the same palette,

>>>>the event will not be raised.

>>>> void Current_PaletteResolve(object sender, PaletteResolveEventArgs e) {

>>>> if (e.Palette.Name == "MyCustomPalette") {

>>>> using (MemoryStream colorStream = new

>>>> MemoryStream(PaletteCustomization.Properties.Resources.Custom)) {

>>>> using (MemoryStream mappingStream = new

>>>> MemoryStream(PaletteCustomization.Properties.Resources.Custom_Mapping))

>>>> {

>>>> e.LoadPaletteFromStream(colorStream, mappingStream);

>>>> }

>>>> }

>>>> }

>>>> }

>>>>

>>>>Similar to ChartFX, a palette is made up of 1) a color collection 2) a

>>>>color mapping. In this implementation, I have created a resource called

>>>>PaletteCustomization (WinForms VS2005). This resource contains two

>>>>files: Custom and Custom_Mapping;

>>>>

>>>>4) Create the palette files. This is an example for Custom:

>>>>

>>>>RGB(0,0,0)

>>>>RGB(255,255,255)

>>>>RGB(199,199,199)

>>>>RGB(224,224,224)

>>>>RGB(81,121,214)

>>>>RGB(239,47,65)

>>>>RGB(255,199,0)

>>>>RGB(186,229,92)

>>>>RGB(7,186,206)

>>>>RGB(168,168,168)

>>>>RGB(218, 231, 248); Alt BG

>>>>RGB(64,64,64);

>>>>RGB(192,150,0);alt start

>>>>RGB(140,172,69);

>>>>RGB(61,91,161);

>>>>RGB(102,102,102);others

>>>>RGB(72,38,35)

>>>>

>>>>And for Custom_Mapping:

>>>>OutsideBorder, 10

>>>>InsideBorder, 1

>>>>Indicator, 1

>>>>MajorTickmark, 9

>>>>MediumTickmark, 9

>>>>MinorTickmark, 9

>>>>Scale, 3

>>>>ScaleBorder, 9

>>>>StripBorder, 15

>>>>Label, 15

>>>>CapColor, 15

>>>>NumericalCharacter, 5

>>>>Cover, 15

>>>>Section1, 6

>>>>Section2, 7

>>>>Section3, 4

>>>>AlternateSection1, 12

>>>>AlternateSection2, 13

>>>>AlternateSection3, 14

>>>>

>>>>For example, MajorTickmark has a color index of 9. The 9th color in

>>>>Custom is RGB(168,168,168).

>>>>

>>>>

>>>>Be free to post again if you need more information.

>>>>

>>>>

>>>>"Oliver Denzel" <ODE@mik.de> wrote in message

>>>>news:nW1QuMneGHA.1536@webserver3.softwarefx.com...

>>>>

>>>>

>>>>>Hi!

>>>>>

>>>>>I recently got a hotfix, the dlls are from 3rd May 06. Is this new

>>>>>enough?

>>>>>And how do I customize the palette then?

>>>>>

>>>>>Regards

>>>>>

>>>>>Oliver Denzel

>>>>>

>>>>>Software FX Support wrote:

>>>>>

>>>>>

>>>>>>Dear Olivier:

>>>>>>

>>>>>>Palette customization will be one of the many new features part of the

>>>>>>next service pack. However, the bits are ready as far as the

>>>>>>customization is concerned. Please contact support@softwarefx.com for

>>>>>>more details on how to get the HotFixes. Make sure to refer this

>>>>>>newsgroup post in your email.

>>>>>>

>>>>>>Regards,

>>>>>>

>>>>>>--

>>>>>>PR

>>>>>>

>>>>>>

>>>>>>

>>>>>>"Oliver Denzel" <ODE@mik.de> wrote in message

>>>>>>news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

>>>>>>

>>>>>>

>>>>>>

>>>>>>>Hi!

>>>>>>>

>>>>>>>How can I create my own Palette for the Gauges?

>>>>>>>

>>>>>>>Regards

>>>>>>>

>>>>>>>Oliver Denzel

>>>>>>

>>>>>>

>>

Share this post


Link to post
Share on other sites

Dear Olivier:

Please contact Support to get the latest hotfix for Gauges, as I have just

fixed the problem. BTW, we are really close to release a full-feature

service pack in the coming days. The service pack will contain in-depth

documentation on how to customize the gauge.

Regards,

--

PR

"Oliver Denzel" <ODE@mik.de> wrote in message

news:bz8CF%23jfGHA.1536@webserver3.softwarefx.com...

> Hi!

>

> Yes, the code in the eventhandler gets executed, and the name of the

> Palette is MIK-Test as I specified. So the code in the if clause also gets

> executed.

>

> Any other hints?

>

> Regards

>

> Oliver Denzel

>

> Software FX Support wrote:

>> Dear Olivier:

>>

>> Do you subscribe to the event before rendering the gauge? Is your event

>> handler being called? If so, what is the value of e.Palette.Name?

>>

>> Regards,

>>

>> --

>> PR

>>

>>

>> "Oliver Denzel" <ODE@mik.de> wrote in message

>> news:pxd$T6oeGHA.3992@webserver3.softwarefx.com...

>>

>>>Hi!

>>>

>>>I implemented your suggestion, with a change: I read the palette from

>>>files. Therefore my code looks like this:

>>>

>>>private void Current_PaletteResolve(object sender,

>>>ChartFX.WinForms.Gauge.Customization.PaletteResolveEventArgs e)

>>>{

>>>if (e.Palette.Name.StartsWith("MIK"))

>>>{

>>>try

>>>{

>>>using (FileStream colorStream = new FileStream("C:\\custom.txt",

>>>FileMode.Open))

>>>{

>>>using (FileStream mappingStream = new

>>>FileStream("C:\\custom_mapping.txt", FileMode.Open))

>>>{

>>>e.LoadPaletteFromStream(colorStream, mappingStream);

>>>}

>>>}

>>>}

>>>catch (Exception ex)

>>>{

>>>log.Info("Exception on loading palette: ", ex);

>>>}

>>>}

>>>}

>>>The code executes without an exception, but afterwards there is an

>>>exception, that the palette MIK-Test (which I defined) is not resolved.

>>>

>>>Regards

>>>

>>>Oliver Denzel

>>>

>>>Software FX Support wrote:

>>>

>>>>Dear Olivier:

>>>>

>>>>

>>>>The customization of the Gauges relies on a singleton object called

>>>>ResourceLibrary. This object follows a pull model, i.e., it will ask

>>>>when it needs to load a custom palette.

>>>>

>>>>1) Subscribe to the PaletteResolve event:

>>>> ResourceLibrary.Current.PaletteResolve += new

>>>> PaletteResolveHandler(Current_PaletteResolve);

>>>>

>>>>2) Create a custom palette, and assign it to the gauge.

>>>>myGauge.Palette = new Palette("MyCustomPalette");

>>>>

>>>>The string identifier of the palette can be anything. However,

>>>>myGauge.Palette = new Palette("EarthThones"); is equivalent to

>>>>myGauge.Palette = Palette.EarthThones. The "EarthThones" palette is

>>>>built-in, and cannot be customized.

>>>>

>>>>3) Implement the event handler. The event handler will only be called

>>>>once, because the palette will be cached in a static variable.

>>>>Therefore, if you create a new gauge, and assign it to the same palette,

>>>>the event will not be raised.

>>>> void Current_PaletteResolve(object sender, PaletteResolveEventArgs e) {

>>>> if (e.Palette.Name == "MyCustomPalette") {

>>>> using (MemoryStream colorStream = new

>>>> MemoryStream(PaletteCustomization.Properties.Resources.Custom)) {

>>>> using (MemoryStream mappingStream = new

>>>> MemoryStream(PaletteCustomization.Properties.Resources.Custom_Mapping))

>>>> {

>>>> e.LoadPaletteFromStream(colorStream, mappingStream);

>>>> }

>>>> }

>>>> }

>>>> }

>>>>

>>>>Similar to ChartFX, a palette is made up of 1) a color collection 2) a

>>>>color mapping. In this implementation, I have created a resource called

>>>>PaletteCustomization (WinForms VS2005). This resource contains two

>>>>files: Custom and Custom_Mapping;

>>>>

>>>>4) Create the palette files. This is an example for Custom:

>>>>

>>>>RGB(0,0,0)

>>>>RGB(255,255,255)

>>>>RGB(199,199,199)

>>>>RGB(224,224,224)

>>>>RGB(81,121,214)

>>>>RGB(239,47,65)

>>>>RGB(255,199,0)

>>>>RGB(186,229,92)

>>>>RGB(7,186,206)

>>>>RGB(168,168,168)

>>>>RGB(218, 231, 248); Alt BG

>>>>RGB(64,64,64);

>>>>RGB(192,150,0);alt start

>>>>RGB(140,172,69);

>>>>RGB(61,91,161);

>>>>RGB(102,102,102);others

>>>>RGB(72,38,35)

>>>>

>>>>And for Custom_Mapping:

>>>>OutsideBorder, 10

>>>>InsideBorder, 1

>>>>Indicator, 1

>>>>MajorTickmark, 9

>>>>MediumTickmark, 9

>>>>MinorTickmark, 9

>>>>Scale, 3

>>>>ScaleBorder, 9

>>>>StripBorder, 15

>>>>Label, 15

>>>>CapColor, 15

>>>>NumericalCharacter, 5

>>>>Cover, 15

>>>>Section1, 6

>>>>Section2, 7

>>>>Section3, 4

>>>>AlternateSection1, 12

>>>>AlternateSection2, 13

>>>>AlternateSection3, 14

>>>>

>>>>For example, MajorTickmark has a color index of 9. The 9th color in

>>>>Custom is RGB(168,168,168).

>>>>

>>>>

>>>>Be free to post again if you need more information.

>>>>

>>>>

>>>>"Oliver Denzel" <ODE@mik.de> wrote in message

>>>>news:nW1QuMneGHA.1536@webserver3.softwarefx.com...

>>>>

>>>>

>>>>>Hi!

>>>>>

>>>>>I recently got a hotfix, the dlls are from 3rd May 06. Is this new

>>>>>enough?

>>>>>And how do I customize the palette then?

>>>>>

>>>>>Regards

>>>>>

>>>>>Oliver Denzel

>>>>>

>>>>>Software FX Support wrote:

>>>>>

>>>>>

>>>>>>Dear Olivier:

>>>>>>

>>>>>>Palette customization will be one of the many new features part of the

>>>>>>next service pack. However, the bits are ready as far as the

>>>>>>customization is concerned. Please contact support@softwarefx.com for

>>>>>>more details on how to get the HotFixes. Make sure to refer this

>>>>>>newsgroup post in your email.

>>>>>>

>>>>>>Regards,

>>>>>>

>>>>>>--

>>>>>>PR

>>>>>>

>>>>>>

>>>>>>

>>>>>>"Oliver Denzel" <ODE@mik.de> wrote in message

>>>>>>news:l2Mjl6AdGHA.3992@webserver3.softwarefx.com...

>>>>>>

>>>>>>

>>>>>>

>>>>>>>Hi!

>>>>>>>

>>>>>>>How can I create my own Palette for the Gauges?

>>>>>>>

>>>>>>>Regards

>>>>>>>

>>>>>>>Oliver Denzel

>>>>>>

>>>>>>

>>

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...