cannot convert type system.web.ui.webcontrols.unit to double

  • Thread starter Thread starter Praveen
  • Start date Start date
Praveen,
Have you tried using the Unit.Value property?

Unit unit = Unit.Pixel(100);
Double value = unit.Value;

Hope this helps
Jay
 
Hello Jay,

Thanks for replying me back.
This is the exact line where I'm getting the error..

double puy = (this.CEnvelope.maxy -
this.CEnvelope.miny) / (double) this.ImageM.Height ;

Where/how to include Unit.Value property? I'm a novice in
C#. Could you please help me on this.

Regards
Praveen
 
Praveen,
What type is this code in? (What type is "this").

What exactly is a CEnvelope, specifically the maxy & miny properties/fields?

What type ImageM, specifically the Height property/field.

Unfortunately I am not physic and able to derive what you are doing from the
2 lines you posted.

Have you tried:
double puy = (this.CEnvelope.maxy.Value -
this.CEnvelope.miny.Value) / (double) this.ImageM.Height.Value ;

I suspect two of them will error, while one will not.

In other words You need to put .Value on the property (miny, maxy, or
Height) that is of type Unit!

Hope this helps
Jay
 
Back
Top