alfcen Well-Known Member Licensed User Longtime User Jan 16, 2011 #1 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.
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.
Erel B4X founder Staff member Licensed User Longtime User Jan 16, 2011 #2 By default ImageView uses Gravitiy.Fill and therefore scales the image automatically to fill its area.
By default ImageView uses Gravitiy.Fill and therefore scales the image automatically to fill its area.
alfcen Well-Known Member Licensed User Longtime User Jan 16, 2011 #3 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).
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).
Erel B4X founder Staff member Licensed User Longtime User Jan 16, 2011 #4 Isn't it enough to use 'dip' units with all numeric parameters?
alfcen Well-Known Member Licensed User Longtime User Jan 17, 2011 #5 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.
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 Jan 17, 2011 #6 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: 636 VB6ScaleModes1.jpg 35.1 KB · Views: 693
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.
alfcen Well-Known Member Licensed User Longtime User Jan 17, 2011 #7 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 Click to expand... 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.
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 Click to expand... 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.
Erel B4X founder Staff member Licensed User Longtime User Jan 18, 2011 #8 So if I understand you want to change the coordinates scale (and also the origin position)? I guess that you can create a sub that will translate those coordinates for you.
So if I understand you want to change the coordinates scale (and also the origin position)? I guess that you can create a sub that will translate those coordinates for you.
alfcen Well-Known Member Licensed User Longtime User Jan 18, 2011 #9 Fair enough, but additional code is exactly what I like avoid.