Scale for ImageView

alfcen

Well-Known Member
Licensed User
Longtime User
If possible, I'd appreciate something like

ImageView1.Scale(x1,y1,x2,y2)

analogue to VB6. This would simplify drawing by eliminating need for scale factors.
 

alfcen

Well-Known Member
Licensed User
Longtime User
Right, Erel, but if you assign an ImageView to a canvas for drawing, then scaling would be helpful,
such as when you plot geo locations on a map with an ImageView scaled as
ImageView1.Scale(-180,90,180,-90).
 

alfcen

Well-Known Member
Licensed User
Longtime User
Sorry, I doubt it, at least I do not know how this could work in analogy to the convenience of "Scale".
Anyway, it's not that a crucial issue. I am always looking for means that help shorten und simplify source codes.
 

klaus

Expert
Licensed User
Longtime User
I'm afraid that you don't speek of the same kind of scaling.
dip scales the objects on the screen.
alfcen means having a physical scale for the pixels.
Having an ImageView of 100dip by 100dip.
Setting ImageView.Scale((-180,90,180,-90)
means that the x value of pixel(0,0)=-180 and the y value = 90
and the x value of pixel(99dip,99dip)=180 and the y value = -90

I remeber having used the ScaleMode feature in VB6 too.
Height/Width 100 pixels
ScaleHeight= 180 ScaleWidth=360, physical unit

I hope this clarifies a bit the question.

Best regards.
 

Attachments

  • VB6ScaleModes.jpg
    12 KB · Views: 343
  • VB6ScaleModes1.jpg
    35.1 KB · Views: 350

alfcen

Well-Known Member
Licensed User
Longtime User
Thanks a lot for monitoring this thread and for your help, Klaus.

Setting ImageView.Scale((-180,90,180,-90)
means that the x value of pixel(0,0)=-180 and the y value = 90
and the x value of pixel(99dip,99dip)=180 and the y value = -90

That is exactly what I was trying to say, sorry for insufficient details.
'Scale' as quoted above, would help plot geo coords with a minimum of code.

Only if this would not be too much of trouble.
 

alfcen

Well-Known Member
Licensed User
Longtime User
Fair enough, but additional code is exactly what I like avoid.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…