uk.co.martinpearman.b4a.touchimageview
Class TouchImageViewWrapper

java.lang.Object
  extended by anywheresoftware.b4a.AbsObjectWrapper<T>
      extended by anywheresoftware.b4a.objects.ViewWrapper<uk.co.martinpearman.b4a.touchimageview.TouchImageView>
          extended by uk.co.martinpearman.b4a.touchimageview.TouchImageViewWrapper
All Implemented Interfaces:
anywheresoftware.b4a.ObjectWrapper<uk.co.martinpearman.b4a.touchimageview.TouchImageView>

public class TouchImageViewWrapper
extends anywheresoftware.b4a.objects.ViewWrapper<uk.co.martinpearman.b4a.touchimageview.TouchImageView>


Field Summary
 
Fields inherited from class anywheresoftware.b4a.objects.ViewWrapper
lastId
 
Fields inherited from class anywheresoftware.b4a.AbsObjectWrapper
Activity_LoadLayout_Was_Called
 
Constructor Summary
TouchImageViewWrapper()
           
 
Method Summary
 void CreateLog()
          Creates log entries with details about the current state of the TouchImageView.
 android.graphics.Bitmap getBackgroundImage()
          Get or Set the BackgroundImage.
 int getClickPeriod()
          Get or Set the ClickPeriod in milliseconds.
 anywheresoftware.b4a.objects.drawable.CanvasWrapper.RectWrapper GetDestRect()
          Returns a Rect that describes the current scale and position of the image within the TouchImageView.
 int getGravity()
          Get or Set the Gravity of the BackgroundImage.
 float getMaxScale()
          Get or set the maximum scale that the image can be enlarged by (zoomed in).
 float getMinScale()
          Get or set the minimum scale that the image can be reduced by (zoomed out).
 float getScaleX()
          Get the factor which the image is currently scaled by on it's X axis.
 float getScaleY()
          Get the factor which the image is currently scaled by on it's Y axis.
 boolean getTouchEnabled()
          Get or Set whether touch events are enabled.
 int getTranslatePadding()
          Get or set the minimum number of pixels that the image will always display within the TouchImageView.
 void Initialize(anywheresoftware.b4a.BA pBA, String EventName)
           
 void innerInitialize(anywheresoftware.b4a.BA pBA, String pEventName, boolean pKeepOldObject)
           
 void PreScale(float Scale, int PointX, int PointY)
          Change the current image scale by Scale, centering the change on (X, Y).
 void ScaleSrcRectToDestRect(android.graphics.Rect SrcRect, android.graphics.Rect DestRect, String ScaleToFit)
          Scale and position the area of the (foreground) image defined by SrcRect to the area of the TouchImageView defined by DestRect.
 void setBackgroundImage(android.graphics.Bitmap aBitmap)
           
 void SetBitmap(anywheresoftware.b4a.BA pBA, android.graphics.Bitmap aBitmap)
          Set the (foreground) image.
 void setClickPeriod(int ClickPeriod)
           
 void setGravity(int Gravity)
           
 void setMaxScale(float MaxScale)
           
 void setMinScale(float MinScale)
           
 void setTouchEnabled(boolean Enabled)
           
 void setTranslatePadding(int TranslatePadding)
           
 
Methods inherited from class anywheresoftware.b4a.objects.ViewWrapper
BringToFront, build, buildNativeView, getBackground, getEnabled, getHeight, getLeft, getTag, getTop, getVisible, getWidth, Invalidate, Invalidate2, Invalidate3, RemoveView, RequestFocus, SendToBack, setBackground, SetBackgroundImage, setColor, setEnabled, setHeight, SetLayout, setLeft, setTag, setTop, setVisible, setWidth, toString
 
Methods inherited from class anywheresoftware.b4a.AbsObjectWrapper
baseToString, ConvertToWrapper, equals, getObject, getObjectOrNull, hashCode, IsInitialized, setObject
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TouchImageViewWrapper

public TouchImageViewWrapper()
Method Detail

CreateLog

public void CreateLog()
Creates log entries with details about the current state of the TouchImageView.


getBackgroundImage

public android.graphics.Bitmap getBackgroundImage()
Get or Set the BackgroundImage.


getClickPeriod

public int getClickPeriod()
Get or Set the ClickPeriod in milliseconds. The ClickPeriod is the threshold between a click being treated as a Click or a LongClick. The default ClickPeriod is 200 milliseconds.


GetDestRect

public anywheresoftware.b4a.objects.drawable.CanvasWrapper.RectWrapper GetDestRect()
Returns a Rect that describes the current scale and position of the image within the TouchImageView.


getGravity

public int getGravity()
Get or Set the Gravity of the BackgroundImage.


getMinScale

public float getMinScale()
Get or set the minimum scale that the image can be reduced by (zoomed out). Default MinScale is 0.5.


getMaxScale

public float getMaxScale()
Get or set the maximum scale that the image can be enlarged by (zoomed in). Default MaxScale is 1.5.


getScaleX

public float getScaleX()
Get the factor which the image is currently scaled by on it's X axis.


getScaleY

public float getScaleY()
Get the factor which the image is currently scaled by on it's Y axis.


getTouchEnabled

public boolean getTouchEnabled()
Get or Set whether touch events are enabled.


getTranslatePadding

public int getTranslatePadding()
Get or set the minimum number of pixels that the image will always display within the TouchImageView. Default TranslatePadding is 64 pixels. The image can not be dragged out of visibility, at least 64 pixels of width and height will always be visible.


Initialize

public void Initialize(anywheresoftware.b4a.BA pBA,
                       String EventName)
Overrides:
Initialize in class anywheresoftware.b4a.objects.ViewWrapper<uk.co.martinpearman.b4a.touchimageview.TouchImageView>

innerInitialize

public void innerInitialize(anywheresoftware.b4a.BA pBA,
                            String pEventName,
                            boolean pKeepOldObject)
Overrides:
innerInitialize in class anywheresoftware.b4a.objects.ViewWrapper<uk.co.martinpearman.b4a.touchimageview.TouchImageView>

PreScale

public void PreScale(float Scale,
                     int PointX,
                     int PointY)
Change the current image scale by Scale, centering the change on (X, Y). For example a Scale value of 1.5 will increase the current scale by 150%.


ScaleSrcRectToDestRect

public void ScaleSrcRectToDestRect(android.graphics.Rect SrcRect,
                                   android.graphics.Rect DestRect,
                                   String ScaleToFit)
Scale and position the area of the (foreground) image defined by SrcRect to the area of the TouchImageView defined by DestRect. ScaleToFit controls how the image should be aligned in the DestRect: CENTER - Center and maximise the image to fit the DestRect maintaining the aspect ratio. END - Maximise the image to fit the DestRect maintaining the aspect ratio, align the image with the bottom and right edges of the DestRect. FILL - Maximise the image to completely fill the DestRect, the aspect ratio may not be maintained. START - Maximise the image to fit the DestRect maintaining the aspect ratio, align the image with the top and left edges of the DestRect.


setBackgroundImage

public void setBackgroundImage(android.graphics.Bitmap aBitmap)

SetBitmap

public void SetBitmap(anywheresoftware.b4a.BA pBA,
                      android.graphics.Bitmap aBitmap)
Set the (foreground) image.


setClickPeriod

public void setClickPeriod(int ClickPeriod)

setGravity

public void setGravity(int Gravity)

setMinScale

public void setMinScale(float MinScale)

setMaxScale

public void setMaxScale(float MaxScale)

setTouchEnabled

public void setTouchEnabled(boolean Enabled)

setTranslatePadding

public void setTranslatePadding(int TranslatePadding)