convert web unit (pixels) to integer
I have placed an image control (500px x 250px) on an asp.net page, and I want to pass the width and height to integer (or any numeric) variables.
In sub Page_Load, my attemped conversion code is:
ImageWidth = ChangeType(Me.pbLineChart.Width, TypeCode.Int32)
Imageheight = ChangeType(Me.pbLineChart.Height, TypeCode.Int32)
(ImageHeight & ImageWidth public variables declared elsewhere).
This generates a runtime error:
Object must implement IConvertible.
Which I have attempted to do without success, but which seems to be related to other language issues.
Any suggestions correct way to do this?
|