Low quality of bitmapdata objects

FJS

Active Member
Licensed User
Longtime User
Good afternoon,

I have a problem with the quality of bitmap objects, even with the new issue 2.71 this situation doesnt change.

I use gv. (as gameview) to made a tiny game (45 gv. elements, I am not sure whether it is too much or not) and one layout I have several images (I define these images from designer) and several bitmapdata which are defined in the code:


I load the the bitmapdata like following way:

Dim a as bitmapdata
Dim b as imageview

In both case I use the following sentence to load the picture (not on the designer, but on the code ):

a.Bitmap=LoadBitmap(File.DirAssets,"examplea.png")
b.Bitmap=LoadBitmap(File.DirAssets,"exampleb.png")

But when run the app in the movilphone, I find "b" objets have a good quality, but the "a" objets have a very poor quality, however with the previus issue of program, it didnot happend (with 2.52)

I have found any coments in logs, but there is not any...

Please could you tell me any clue?, I tried write LoadBitmapSample in one object, but it didnt work :( (maybedo i need to load everything like this way?)

Could you help me?
Here after there is a picture, the orange botton are image objets (they have the right quality) and in the left there is a bitmapdata object (with poor quality)
Thank you very much for your support
 

Attachments

  • Screenshot.jpg
    Screenshot.jpg
    17.2 KB · Views: 236
Last edited:

FJS

Active Member
Licensed User
Longtime User
It looks great in your examples. But how is possible to combine with gameview?
I only need load with quality the bitmaps. Do you have any example about this point?
Is it possible to made a game with high quality with this library? how?


I have just use the following code, and the results is the same ( it doesnt work better than gameview), with the imageview the quality is very high and with the bitmapdata objects the quality is poor:

-------------------------------------------------------------------------------------------------
#Region Activity Attributes
#FullScreen: true
#IncludeTitle: false
#End Region

Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.

'***************************************
' Parameter of Module B (Main menu)
'***************************************
Dim b,c, timebotton As Double
b=0.65
c=150
Dim language As String
language="EN"
Dim spf As Int
spf=25
timebotton=200

'***************************************
Dim modegame As Int
modegame=1

Dim x,y,a,ho As Double
Dim imageview1,imageview2 As ImageView
Dim picture1,picture2 As Bitmap

Dim AcSf As AcceleratedSurface
Dim IU As AS_ImageUtils

'Dim gv As GameView

End Sub

Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")

AcSf.Initialize("AcSf", True)
Activity.AddView(AcSf, 0, 0, 100%x, 100%y)

'gv.Initialize("gv")
' Activity.AddView(gv, 0, 0, 100%x, 100%y)

' gv.BitmapsData.Add(picture1)
' gv.BitmapsData.Add(picture2)


Activity.LoadLayout("testpictures")

x=Activity.Width/100.000
y=Activity.Height/100.000

imageview1.Visible=True
a=0.23
imageview1.Width=110*x*a
imageview1.Height=130*x*a
imageview1.Left=1*x
imageview1.Top=20*x

imageview2.Visible=True
a=0.23
imageview2.Width=330*x*a
imageview2.Height=110*x*a
imageview2.Top=20*x
imageview2.Left=24*x

picture1 = IU.LoadScaledBitmap(File.DirAssets,"questionbotton_110x130.png",110*1.8,130*1.8,False)

picture2 = IU.LoadScaledBitmap(File.DirAssets,"score_330x110.png",330*1.8,110*1.8,False)

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub AcSf_Draw(AC As AS_Canvas)

AC.DrawBitmapAt(picture1, 15, 380)
AC.DrawBitmapAt(picture2, 200, 380)

End Sub

----------------------------------------------------------------------------------------------------------------
Thank you for your help
 
Last edited:
Upvote 0

Informatix

Expert
Licensed User
Longtime User
It looks great in your examples. But how is possible to combine with gameview?

The functions of the AS_ImageUtils class can be used without any problem with GameView. The other classes cannot be used.

I only need load with quality the bitmaps. Do you have any example about this point?

LoadScaledBitmap has been designed to save memory without sacrificing quality. You have nothing else to do than using it.

Is it possible to made a game with high quality with this library? how?

It depends on what you expect. If you want to display hundreds of sprites on screen, it's too slow. If you want to do a Pacman, an Angry Birds or a classic RPG, that's enough.

I have just use the following code, and the results is the same ( it doesnt work better than gameview), with the imageview the quality is very high and with the bitmapdata objects the quality is poor:

The problem is not the functions but your code.
1) You did not activate the filter of LoadScaledBitmap despite it is stated that it is there for quality.
2) You compare two images with different sizes.
Example:
Width of the image view = 330*x*a = 330 * Activity.Width/100 * 0.23 = 607 on a 800x600 screen, 971 on a 1280x720 screen
Width of the bitmap = 330*1.8 = 594 whatever screen you have

After fixing that, could you send a screenshot of the result?
 
Upvote 0

FJS

Active Member
Licensed User
Longtime User
In the following picture, we can see:

Imageview objects
bitmap objects with LoadScaledBitmap "true"
bitmap objects without loadscaledbitmap

Erel, do you know how obtain the same resolution with gameview?
Could do you give us an example about combine loadscalebitmap with gameview?

Thank you for your time and support
 

Attachments

  • test002.jpg
    test002.jpg
    81.6 KB · Views: 202
Upvote 0

Informatix

Expert
Licensed User
Longtime User
In the following picture, we can see:

Imageview objects
bitmap objects with LoadScaledBitmap "true"
bitmap objects without loadscaledbitmap

Erel, do you know how obtain the same resolution with gameview?
Could do you give us an example about combine loadscalebitmap with gameview?

Thank you for your time and support

I think you don't understand how to draw a bitmap with GameView. Post your code and I'll explain what's wrong.
 
Upvote 0

FJS

Active Member
Licensed User
Longtime User
I have just to understand... (I think so)


#Region Activity Attributes
#FullScreen: true
#IncludeTitle: false
#End Region

Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.

End Sub

Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.

'***************************************
' Parameter of Module B (Main menu)
'***************************************
Dim b,c, timebotton As Double
b=0.65
c=150
Dim language As String
language="EN"
Dim spf As Int
spf=25
timebotton=200

'***************************************
Dim modegame As Int
modegame=1

Dim x,y,a,ho As Double
Dim imageview1,imageview2 As ImageView
Dim picture1,picture2 As BitmapData
Dim picture1b,picture2b As Bitmap

Dim AcSf As AcceleratedSurface
Dim IU As AS_ImageUtils

Dim gv As GameView

End Sub

Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")

AcSf.Initialize("AcSf", True)
Activity.AddView(AcSf, 0, 0, 100%x, 100%y)

gv.Initialize("gv")
Activity.AddView(gv, 0, 0, 100%x, 100%y)

gv.BitmapsData.Add(picture1)
gv.BitmapsData.Add(picture2)


Activity.LoadLayout("testpictures")

x=Activity.Width/100.000
y=Activity.Height/100.000

imageview1.Visible=True
a=0.23
imageview1.Width=110*x*a
imageview1.Height=130*x*a
imageview1.Left=1*x
imageview1.Top=20*x

imageview2.Visible=True
a=0.23
imageview2.Width=330*x*a
imageview2.Height=110*x*a
imageview2.Top=20*x
imageview2.Left=24*x

picture1.Bitmap = IU.LoadScaledBitmap(File.DirAssets,"questionbotton_110x130.png",110*1.84,130*1.84,True)

picture2.Bitmap = IU.LoadScaledBitmap(File.DirAssets,"score_330x110.png",330*1.84,110*1.84,True)

picture1.DestRect.Initialize(8, 380, 110*1.84+8, 130*1.84+380)
picture2.DestRect.Initialize(192, 380, 330*1.84+192, 110*1.84+380)

picture1b = IU.LoadScaledBitmap(File.DirAssets,"questionbotton_110x130.png",110*1.84,130*1.84,False)

picture2b = IU.LoadScaledBitmap(File.DirAssets,"score_330x110.png",330*1.84,110*1.84,False)

End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub AcSf_Draw(AC As AS_Canvas)

'AC.DrawBitmapAt(picture1, 8, 380)
'AC.DrawBitmapAt(picture2, 192, 380)

AC.DrawBitmapAt(picture1b, 8, 600)
AC.DrawBitmapAt(picture2b, 192, 600)

End Sub




It works, the quality is high! it is great!
 
Last edited:
Upvote 0
Top