Android Programming Press on the image to return to the main documentation page.

BitmapCreator

List of types:

ARGBColor
BCBrush
BCPath
BitmapCreator
CompressedBC
DrawTask
InternalAntiAliasingBuffer
InternalBCColumn
InternalBCPathColumnData
InternalBCPathPointData
InternalCanvasDrawTask
InternalCompressedBCCache
PremultipliedColor

ARGBColor


Events:

None

Members:


  an style="color: #000000; ">a As Int

  b As Int

  g As Int

  Initialize

  IsInitialized As Boolean

  r As Int

Members description:

a As Int
b As Int
g As Int
Initialize
Initializes the fields to their default value.
IsInitialized As Boolean
Tests whether the object has been initialized.
r As Int

BCBrush


Events:

None

Members:


  BlendAll As Boolean

  BlendBorders As Boolean

  ColorPM As PremultipliedColor

  Initialize

  IsColorSource As Boolean

  IsInitialized As Boolean

  Source As BitmapCreator

  SrcOffsetX As Int

  SrcOffsetY As Int

Members description:

BlendAll As Boolean
BlendBorders As Boolean
ColorPM As PremultipliedColor
Initialize
Initializes the fields to their default value.
IsColorSource As Boolean
IsInitialized As Boolean
Tests whether the object has been initialized.
Source As BitmapCreator
SrcOffsetX As Int
SrcOffsetY As Int

BCPath


Events:

None

Members:


  Class_Globals As String

  Clone As BCPath

  DrawConnectionSegments As Boolean

  FindBoundingRect As B4XRect

  Initialize (X As Float, Y As Float) As BCPath

  InternalCounterClockWise As Boolean

  Invalidate As String

  IsInitialized As Boolean

  LineTo (X As Float, Y As Float) As BCPath

  Points As List

  PrepareForFilling As String

  RemoveLastPoint As String

  Reset (X As Float, Y As Float) As BCPath

Members description:

Class_Globals As String
Clone As BCPath
Creates a copy of the path. This is used by BitmapCreator.AsyncDrawPath.
DrawConnectionSegments As Boolean
FindBoundingRect As B4XRect
Returns the path bounding rectangle.
Initialize (X As Float, Y As Float) As BCPath
Initializes the path and sets the first point.
InternalCounterClockWise As Boolean
Invalidate As String
Call Invalidate if you modifed the Points list directly.
IsInitialized As Boolean
Tests whether the object has been initialized.
LineTo (X As Float, Y As Float) As BCPath
Adds a line to the given point.
Points As List
PrepareForFilling As String
Internal sub.
RemoveLastPoint As String
Removes the last point.
Reset (X As Float, Y As Float) As BCPath
Resets the path.

BitmapCreator

version 4.50

Events:

BitmapReady (bmp As B4XBitmap)

Members:


  ARGBToColor (ARGB As ARGBColor) As Int

  ARGBToPremultipliedColor (ARGB As ARGBColor, PM As PremultipliedColor) As PremultipliedColor

  AsyncDrawCircle (X As Float, Y As Float, Radius As Float, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int) As DrawTask

  AsyncDrawLine (X0 As Float, Y0 As Float, X1 As Float, Y1 As Float, Brush As BCBrush, StrokeWidth As Int) As DrawTask

  AsyncDrawPath (Path As BCPath, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int) As DrawTask

  AsyncDrawRect (Rect As B4XRect, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int) As DrawTask

  AsyncDrawRectRounded (Rect As B4XRect, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int, CornersRadius As Int) As DrawTask

  Bitmap As B4XBitmapWrapper [read only]

  BlendPixel (Source As BitmapCreator, SrcX As Int, SrcY As Int, TargetX As Int, TargetY As Int) As String

  BlendPixel2 (SrcPM As PremultipliedColor, TargetX As Int, TargetY As Int) As String

  Buffer() As Byte [read only]

  Class_Globals As String

  ColorToARGB (Clr As Int, Result As ARGBColor) As ARGBColor

  CopyPixel (Source As BitmapCreator, SrcX As Int, SrcY As Int, TargetX As Int, TargetY As Int) As String

  CopyPixelIgnoreSemiTransparent (Source As BitmapCreator, SrcX As Int, SrcY As Int, TargetX As Int, TargetY As Int, SkipBlending As Boolean) As String

  CopyPixelsFromBitmap (SourceBitmap As B4XBitmapWrapper) As String

  CreateBrushFromBitmap (Bmp As B4XBitmapWrapper) As BCBrush

  CreateBrushFromBitmapCreator (BC As BitmapCreator) As BCBrush

  CreateBrushFromColor (Color As Int) As BCBrush

  CreateDrawTask (Source As Object, SrcRect As B4XRect, TargetX As Int, TargetY As Int, SkipBlending As Boolean) As DrawTask

  DrawBitmap (Bmp As B4XBitmapWrapper, TargetRect1 As B4XRect, SkipBlending As Boolean) As String

  DrawBitmapCreator (Source As BitmapCreator, SrcRect As B4XRect, TargetX As Int, TargetY As Int, SkipBlending As Boolean) As String

  DrawBitmapCreatorsAsync (Target As Object, EventName As String, DrawTasks As List) As String

  DrawBitmapCreatorTransformed (Task As DrawTask) As String

  DrawCircle (X As Float, Y As Float, Radius As Float, Color As Int, Filled As Boolean, StrokeWidth As Int) As BCBrush

  DrawCircle2 (X As Float, Y As Float, Radius As Float, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int) As BCBrush

  DrawCompressedBitmap (Source As CompressedBC, SrcRect As B4XRect, TargetX As Int, TargetY As Int) As String

  DrawLine (X0 As Float, Y0 As Float, X1 As Float, Y1 As Float, Color As Int, StrokeWidth As Int) As BCBrush

  DrawLine2 (X0 As Float, Y0 As Float, X1 As Float, Y1 As Float, Brush As BCBrush, StrokeWidth As Int) As BCBrush

  DrawPath (Path As BCPath, Color As Int, Filled As Boolean, StrokeWidth As Int) As BCBrush

  DrawPath2 (Path As BCPath, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int) As BCBrush

  DrawRect (Rect As B4XRect, Color As Int, Filled As Boolean, StrokeWidth As Int) As BCBrush

  DrawRect2 (Rect As B4XRect, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int) As BCBrush

  DrawRectRounded (Rect As B4XRect, Color As Int, Filled As Boolean, StrokeWidth As Int, CornersRadius As Int) As BCBrush

  DrawRectRounded2 (Rect As B4XRect, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int, CornersRadius As Int) As BCBrush

  DrawRotatedCBC (cbc As CompressedBC, Degrees As Float, Width As Int, Height As Int, AABuffer As InternalAntiAliasingBuffer) As String

  ExtractCompressedBC (Rect As B4XRect, Cache As InternalCompressedBCCache) As CompressedBC

  FillGradient (GradColors() As Int, Rect As B4XRect, Orientation As String) As String

  FillRadialGradient (GradColors() As Int, Rect As B4XRect) As String

  FillRect (Color As Int, Rect As B4XRect) As String

  FlipCompressedBitmap (Source As CompressedBC, Horizontal As Boolean, Vertical As Boolean) As CompressedBC

  GetARGB (x As Int, y As Int, Result As ARGBColor) As ARGBColor

  getBitmap As B4XBitmapWrapper

  getBuffer As Byte()

  GetColor (x As Int, y As Int) As Int

  GetPremultipliedColor (x As Int, y As Int, Result As PremultipliedColor) As PremultipliedColor

  Initialize (Width As Int, Height As Int) As String

  IsInitialized As Boolean

  IsTransparent (x As Int, y As Int) As Boolean

  MAX_SAME_COLOR_SIZE As Int

  mHeight As Int

  mWidth As Int

  ReplaceSemiTransparentPixels (NewColor As Int, Rect As B4XRect) As String

  SAME_COLOR_LENGTH_FOR_CACHE As Int

  SetARGB (x As Int, y As Int, ARGB As ARGBColor) As String

  SetBitmapToImageView (Bitmap As B4XBitmapWrapper, ImageView As B4XViewWrapper) As String

  SetColor (x As Int, y As Int, Clr As Int) As String

  SetHSV (x As Int, y As Int, alpha As Int, h As Int, s As Float, v As Float) As String

  SetPremultipliedColor (x As Int, y As Int, Premultiplied As PremultipliedColor) As String

  TargetRect As B4XRect

Members description:

ARGBToColor (ARGB As ARGBColor) As Int
Converts an ARGB value to a color int value.
ARGBToPremultipliedColor (ARGB As ARGBColor, PM As PremultipliedColor) As PremultipliedColor
Converts an ARGB color to PremultipliedColor.
The Result parameter will hold the output.
AsyncDrawCircle (X As Float, Y As Float, Radius As Float, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int) As DrawTask
Asynchronously draws a circle. Returns a DrawTask that should be added to the list of drawing tasks.
AsyncDrawLine (X0 As Float, Y0 As Float, X1 As Float, Y1 As Float, Brush As BCBrush, StrokeWidth As Int) As DrawTask
Asynchronously draws a line. Returns a DrawTask that should be added to the list of drawing tasks.
AsyncDrawPath (Path As BCPath, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int) As DrawTask
Asynchronously draws a path. Returns a DrawTask that should be added to the list of drawing tasks.
Note that you shouldn't modify the path while it is being drawn. You can use BCPath.Clone to create a copy.
AsyncDrawRect (Rect As B4XRect, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int) As DrawTask
Asynchronously draws a rectangle. Returns a DrawTask that should be added to the list of drawing tasks.
AsyncDrawRectRounded (Rect As B4XRect, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int, CornersRadius As Int) As DrawTask
Asynchronously draws a rectangle with round corners. Returns a DrawTask that should be added to the list of drawing tasks.
Bitmap As B4XBitmapWrapper [read only]
Converts the bytes buffer to a bitmap.
BlendPixel (Source As BitmapCreator, SrcX As Int, SrcY As Int, TargetX As Int, TargetY As Int) As String
Copies a single pixel from Source to this BC. If the pixel is non-opaque then it will blend with the current pixel.
BlendPixel2 (SrcPM As PremultipliedColor, TargetX As Int, TargetY As Int) As String
Buffer() As Byte [read only]
Gets the internal buffer.
Class_Globals As String
ColorToARGB (Clr As Int, Result As ARGBColor) As ARGBColor
Converts color int to ARGBColor object.
The Result parameter will hold the output.
CopyPixel (Source As BitmapCreator, SrcX As Int, SrcY As Int, TargetX As Int, TargetY As Int) As String
Copies a single pixel from Source to this BC.
CopyPixelIgnoreSemiTransparent (Source As BitmapCreator, SrcX As Int, SrcY As Int, TargetX As Int, TargetY As Int, SkipBlending As Boolean) As String
CopyPixelsFromBitmap (SourceBitmap As B4XBitmapWrapper) As String
Extracts the pixels from the SourceBitmap and copies them.
Note that the source bitmap is first resized, if needed, to match the BitmapCreator dimensions.
CreateBrushFromBitmap (Bmp As B4XBitmapWrapper) As BCBrush
Creates a BCBrush from the given bitmap. You can reuse the brush.
CreateBrushFromBitmapCreator (BC As BitmapCreator) As BCBrush
Creates a BCBrush from the given BitmapCreator. You can reuse the brush.
Note that the BitmapCreator is not copied.
CreateBrushFromColor (Color As Int) As BCBrush
Creates a BCBrush from the given color. You can reuse the brush.
CreateDrawTask (Source As Object, SrcRect As B4XRect, TargetX As Int, TargetY As Int, SkipBlending As Boolean) As DrawTask
Creates a DrawTask object.
DrawBitmap (Bmp As B4XBitmapWrapper, TargetRect1 As B4XRect, SkipBlending As Boolean) As String
Draws a bitmap to the buffer.
SkipBlending - Whether non-opaque pixels in the source bitmap should blend with the background.
DrawBitmapCreator (Source As BitmapCreator, SrcRect As B4XRect, TargetX As Int, TargetY As Int, SkipBlending As Boolean) As String
Draws the image stored in the Source BitmapCreator to this BitmapCreator.
Source - Source BitmapCreator
SrcRect - Defines the region in the Source BC that will be copied.
TargetX / TargetY - Top left point in the destination BC.
SkipBlending - Whether non-opaque pixels in the source bitmap should blend with the background.
DrawBitmapCreatorsAsync (Target As Object, EventName As String, DrawTasks As List) As String
Asynchronously draws all the draw tasks. Note that no other drawings should be made until the BitmapReady event is raised.
The 'bmp' parameter will not be initialized in B4J.
Target must be a class instance.
Example: bc1.DrawBitmapCreatorsAsync(Me, "BC", Tasks)
Wait For BC_BitmapReady (bmp As B4XBitmap)

DrawBitmapCreatorTransformed (Task As DrawTask) As String
Draws a scaled and / or rotated BitmapCreator.
Task.TargetX / TargetY define the target center. This is different than the behavior in other methods.
Task.SkipBlending = True will treat all pixels with alpha > 0 as solid colors and other pixels as transparent.
DrawCircle (X As Float, Y As Float, Radius As Float, Color As Int, Filled As Boolean, StrokeWidth As Int) As BCBrush
Draws a a circle. Returns the color brush.
DrawCircle2 (X As Float, Y As Float, Radius As Float, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int) As BCBrush
Draws a circle.
DrawCompressedBitmap (Source As CompressedBC, SrcRect As B4XRect, TargetX As Int, TargetY As Int) As String
Draws a CompressedBC object created with BitmapCreator.ExtractCompressBC.
DrawLine (X0 As Float, Y0 As Float, X1 As Float, Y1 As Float, Color As Int, StrokeWidth As Int) As BCBrush
Draws a line. Returns the color brush.
DrawLine2 (X0 As Float, Y0 As Float, X1 As Float, Y1 As Float, Brush As BCBrush, StrokeWidth As Int) As BCBrush
Draws a line.
DrawPath (Path As BCPath, Color As Int, Filled As Boolean, StrokeWidth As Int) As BCBrush
Draws a BCPath. Don't confuse with B4XPath or Path.
Returns the created color brush.
DrawPath2 (Path As BCPath, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int) As BCBrush
Draws a BCPath. Don't confuse with B4XPath or Path.
Non-full paths: Connection segments are drawn between each two lines. You can disable it by setting BCPath.DrawConnectionSegments to False.
This will make the drawing twice as fast (in most cases it will be fast enough anyway).
DrawRect (Rect As B4XRect, Color As Int, Filled As Boolean, StrokeWidth As Int) As BCBrush
Draws a rectangle. Returns the color brush.
DrawRect2 (Rect As B4XRect, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int) As BCBrush
Draws a rectangle.
DrawRectRounded (Rect As B4XRect, Color As Int, Filled As Boolean, StrokeWidth As Int, CornersRadius As Int) As BCBrush
Draws a rectangle with round corners. Returns the color brush.
DrawRectRounded2 (Rect As B4XRect, Brush As BCBrush, Filled As Boolean, StrokeWidth As Int, CornersRadius As Int) As BCBrush
Draws a rectangle with round corners.
DrawRotatedCBC (cbc As CompressedBC, Degrees As Float, Width As Int, Height As Int, AABuffer As InternalAntiAliasingBuffer) As String
Rotates with antialiasing.
ExtractCompressedBC (Rect As B4XRect, Cache As InternalCompressedBCCache) As CompressedBC
FillGradient (GradColors() As Int, Rect As B4XRect, Orientation As String) As String
Fills the rectangle with a gradient. Skips blending.
GradColors - An array of two or more colors that define the gradient.
Rect - The region that will be filled.
Orientation - One of the following: TL_BR, TOP_BOTTOM, TR_BL, LEFT_RIGHT, RIGHT_LEFT, BL_TR, BOTTOM_TOP, BR_TL and RECTANGLE.
FillRadialGradient (GradColors() As Int, Rect As B4XRect) As String
Fills the rectangle with a radial gradient. Skips blending.
FillRect (Color As Int, Rect As B4XRect) As String
DEPRECATED: use DrawRect instead.
FlipCompressedBitmap (Source As CompressedBC, Horizontal As Boolean, Vertical As Boolean) As CompressedBC
GetARGB (x As Int, y As Int, Result As ARGBColor) As ARGBColor
Gets the color of the given point as an ARGB color.
The Result parameter stores the output.
getBitmap As B4XBitmapWrapper
Converts the bytes buffer to a bitmap.
getBuffer As Byte()
Gets the internal buffer.
GetColor (x As Int, y As Int) As Int
Gets the color of the given point as an int value.
GetPremultipliedColor (x As Int, y As Int, Result As PremultipliedColor) As PremultipliedColor
Gets the color of the given point as a premultiplied color. No conversion is required for this format.
The Result parameter stores the output.
Initialize (Width As Int, Height As Int) As String
Initializes the object and sets the bitmap dimensions.
Note that XUI library must be referenced as well.
IsInitialized As Boolean
Tests whether the object has been initialized.
IsTransparent (x As Int, y As Int) As Boolean
Tests whether a given point is completely transparent.
MAX_SAME_COLOR_SIZE As Int
mHeight As Int
mWidth As Int
ReplaceSemiTransparentPixels (NewColor As Int, Rect As B4XRect) As String
Replaces all semi-transparent pixels in the Rect with NewColor.
This can be useful to remove antialiasing effects.
SAME_COLOR_LENGTH_FOR_CACHE As Int
SetARGB (x As Int, y As Int, ARGB As ARGBColor) As String
Sets the color of the specified point.
SetBitmapToImageView (Bitmap As B4XBitmapWrapper, ImageView As B4XViewWrapper) As String
Similar to B4XView.SetBitmap. The difference is in B4A where the Gravity is set to FILL instead of CENTER.
This is useful when you want to use a scaled down bitmap.
In most cases you should use this method instead of B4XView.SetBitmap.
SetColor (x As Int, y As Int, Clr As Int) As String
Sets the color of the given pixel.
SetHSV (x As Int, y As Int, alpha As Int, h As Int, s As Float, v As Float) As String
Sets the color of the specified point.
SetPremultipliedColor (x As Int, y As Int, Premultiplied As PremultipliedColor) As String
Sets the color of the specified point.
TargetRect As B4XRect

CompressedBC


Events:

None

Members:


  Cache As InternalCompressedBCCache

  Initialize

  IsInitialized As Boolean

  mBuffer() As Byte

  mHeight As Int

  mWidth As Int

  Rows As List

  TargetRect As B4XRect

Members description:

Cache As InternalCompressedBCCache
Initialize
Initializes the fields to their default value.
IsInitialized As Boolean
Tests whether the object has been initialized.
mBuffer() As Byte
mHeight As Int
mWidth As Int
Rows As List
TargetRect As B4XRect

DrawTask


Events:

None

Members:


  CanvasTask As InternalCanvasDrawTask

  Degrees As Int

  Initialize

  IsCanvasTask As Boolean

  IsCompressedSource As Boolean

  IsInitialized As Boolean

  SkipBlending As Boolean

  Source As Object

  SrcRect As B4XRect

  SrcScaleX As Float

  SrcScaleY As Float

  TargetBC As BitmapCreator

  TargetX As Int

  TargetY As Int

  Transform As Boolean

Members description:

CanvasTask As InternalCanvasDrawTask
Degrees As Int
Initialize
Initializes the fields to their default value.
IsCanvasTask As Boolean
IsCompressedSource As Boolean
IsInitialized As Boolean
Tests whether the object has been initialized.
SkipBlending As Boolean
Source As Object
SrcRect As B4XRect
SrcScaleX As Float
SrcScaleY As Float
TargetBC As BitmapCreator
TargetX As Int
TargetY As Int
Transform As Boolean

InternalAntiAliasingBuffer


Events:

None

Members:


  Initialize

  IntsArray() As Int

  IsInitialized As Boolean

Members description:

Initialize
Initializes the fields to their default value.
IntsArray() As Int
IsInitialized As Boolean
Tests whether the object has been initialized.

InternalBCColumn


Events:

None

Members:


  EndY As Int

  Initialize

  IsInitialized As Boolean

  LeftSide As Boolean

  StartY As Int

  Values() As Float

Members description:

EndY As Int
Initialize
Initializes the fields to their default value.
IsInitialized As Boolean
Tests whether the object has been initialized.
LeftSide As Boolean
StartY As Int
Values() As Float

InternalBCPathColumnData


Events:

None

Members:


  EndPoint As Float

  Initialize

  IsInitialized As Boolean

  LastY As Float

  MaxY As Float

  MinY As Float

  SignY As Float

  StartPoint As Float

Members description:

EndPoint As Float
Initialize
Initializes the fields to their default value.
IsInitialized As Boolean
Tests whether the object has been initialized.
LastY As Float
MaxY As Float
MinY As Float
SignY As Float
StartPoint As Float

InternalBCPathPointData


Events:

None

Members:


  ColumnData As InternalBCPathColumnData

  Initialize

  IsInitialized As Boolean

  X As Float

  Y As Float

Members description:

ColumnData As InternalBCPathColumnData
Initialize
Initializes the fields to their default value.
IsInitialized As Boolean
Tests whether the object has been initialized.
X As Float
Y As Float

InternalCanvasDrawTask


Events:

None

Members:


  Brush As BCBrush

  Code As Int

  Filled As Boolean

  Initialize

  IsInitialized As Boolean

  Values() As Float

Members description:

Brush As BCBrush
Code As Int
Filled As Boolean
Initialize
Initializes the fields to their default value.
IsInitialized As Boolean
Tests whether the object has been initialized.
Values() As Float

InternalCompressedBCCache


Events:

None

Members:


  ColorsMap As Map

  Initialize

  IsInitialized As Boolean

  mBuffer() As Byte

Members description:

ColorsMap As Map
Initialize
Initializes the fields to their default value.
IsInitialized As Boolean
Tests whether the object has been initialized.
mBuffer() As Byte

PremultipliedColor


Events:

None

Members:


  an style="color: #000000; ">a As Int

  b As Int

  g As Int

  Initialize

  IsInitialized As Boolean

  r As Int

Members description:

a As Int
b As Int
g As Int
Initialize
Initializes the fields to their default value.
IsInitialized As Boolean
Tests whether the object has been initialized.
r As Int

Top