I am not getting a correct graphic back (it is black and has alphalevel of 100):
the Log to it:
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
New graphic: template_target1
B4X:
Dim id As Int
Dim bc As BitmapCreator = ChangeAlphaLevel( X2.GraphicCache.GetGraphic( "template_target3",id ) , 100 )
X2.GraphicCache.PutGraphicBCs(bw.GraphicName, Array(bc), False, 1)
.
.
.
.
Sub ChangeAlphaLevel(CmBC As CompressedBC, NewAlpha As Int) As BitmapCreator
Dim bc As BitmapCreator
bc.Initialize(CmBC.mWidth, CmBC.mHeight)
bc.ExtractCompressedBC(bc.TargetRect, CmBC.Cache)
Dim Alpha As Int
Dim a1 As ARGBColor
a1.Initialize
For y = 0 To bc.mHeight - 1
For x = 0 To bc.mWidth - 1
bc.GetARGB(x, y, a1)
Log(a1)
Alpha = a1.a + NewAlpha
Alpha = Max( 0, Min( Alpha,255 ) )
a1.a = Alpha
bc.SetARGB(x, y, a1)
Next
Next
Return bc
End Sub
the Log to it:
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
[IsInitialized=true, a=0, r=0
, g=0, b=0]
New graphic: template_target1
Last edited: