SDK2.1, WVGA800 return wrong getWidth(), getHeight()

Common bugs/problems with the Android SDK the Emulator and the ADT-Plugin.

Postby pskink » Thu Apr 08, 2010 6:36 pm

also what is display width?

and your view width, assuming it has layout_width="fill_parent"?
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Top

Postby sblantipodi » Thu Apr 08, 2010 6:46 pm

pskink wrote:
what about

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. g.drawBitmap(logo, 0, 0, null);
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


unfortunantly, same problem. :shock:
sblantipodi
Senior Developer
Senior Developer
 
Posts: 122
Joined: Fri Mar 26, 2010 1:41 pm

Postby pskink » Thu Apr 08, 2010 6:48 pm

run hierarchyviewer and see your view width and top-level view width
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby pskink » Thu Apr 08, 2010 6:59 pm

also after drawing logo try:

paint.seColor(0x80ffffff)
paint.setStyle(Style.FILL)
g.drawRect(0,0,logo.getWidth(),logo.getHeight(), paint)
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby sblantipodi » Thu Apr 08, 2010 7:10 pm

pskink wrote:also what is display width?

and your view width, assuming it has layout_width="fill_parent"?


yes, screen size is 800x480, canvas size is 800x480
sblantipodi
Senior Developer
Senior Developer
 
Posts: 122
Joined: Fri Mar 26, 2010 1:41 pm

Postby pskink » Thu Apr 08, 2010 7:15 pm

in level3 ???

what does hierarchyviewer say about top-level view width?
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Top

Postby sblantipodi » Thu Apr 08, 2010 7:17 pm

pskink wrote:in level3 ???


now I'm on level7 240dpi.
sblantipodi
Senior Developer
Senior Developer
 
Posts: 122
Joined: Fri Mar 26, 2010 1:41 pm

Postby sblantipodi » Thu Apr 08, 2010 7:24 pm

pskink wrote:in level3 ???

what does hierarchyviewer say about top-level view width?


it says always 800x480 on every level.
sblantipodi
Senior Developer
Senior Developer
 
Posts: 122
Joined: Fri Mar 26, 2010 1:41 pm

Postby sblantipodi » Thu Apr 08, 2010 7:25 pm

pskink wrote:also after drawing logo try:

paint.seColor(0x80ffffff)
paint.setStyle(Style.FILL)
g.drawRect(0,0,logo.getWidth(),logo.getHeight(), paint)


tryed, it blow up my canvas...
sblantipodi
Senior Developer
Senior Developer
 
Posts: 122
Joined: Fri Mar 26, 2010 1:41 pm

Postby pskink » Thu Apr 08, 2010 7:27 pm

ok, how do you know that drawBitmap draws scaled logo?

did you try to drawRect after drawing logo?
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby pskink » Thu Apr 08, 2010 7:29 pm

sblantipodi wrote:
pskink wrote:also after drawing logo try:

paint.seColor(0x80ffffff)
paint.setStyle(Style.FILL)
g.drawRect(0,0,logo.getWidth(),logo.getHeight(), paint)


tryed, it blow up my canvas...


blow up? what do you mean?
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby sblantipodi » Thu Apr 08, 2010 7:31 pm

pskink wrote:ok, how do you know that drawBitmap draws scaled logo?

did you try to drawRect after drawing logo?


because a 230pixel images, fullfill the screen and is visibly stretched...
If I draw a line after the logo with a width of logo.getWidth
this lines is smaller than the logo. :(
sblantipodi
Senior Developer
Senior Developer
 
Posts: 122
Joined: Fri Mar 26, 2010 1:41 pm

Postby sblantipodi » Thu Apr 08, 2010 7:33 pm

pskink wrote:
sblantipodi wrote:
pskink wrote:also after drawing logo try:

paint.seColor(0x80ffffff)
paint.setStyle(Style.FILL)
g.drawRect(0,0,logo.getWidth(),logo.getHeight(), paint)


tryed, it blow up my canvas...


blow up? what do you mean?


it seems that a white rectangle is drawn over my canvas.
sblantipodi
Senior Developer
Senior Developer
 
Posts: 122
Joined: Fri Mar 26, 2010 1:41 pm

Postby pskink » Thu Apr 08, 2010 7:37 pm

does the rectangke completly cover the logo or is smaller/bigger ?
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Postby sblantipodi » Thu Apr 08, 2010 7:39 pm

pskink wrote:does the rectangke completly cover the logo or is smaller/bigger ?


thanks for your help, I really appreciate it.
it's smaller :(
sblantipodi
Senior Developer
Senior Developer
 
Posts: 122
Joined: Fri Mar 26, 2010 1:41 pm

Top
PreviousNext

Return to SDK/ADT/Emulator Problems

Who is online

Users browsing this forum: No registered users and 3 guests