Re: [android-developers] Re: how to create a custom gauge in android

2013-04-19 Thread abdallah mouhamed amine
hi bob,

am working actuallly on an application like the ADK2011

so mainly my app communicates with a board (like arduino ADK) and get the
temperature value via USB to be displayed

in mu custom gauge

thank you :)



2013/4/18 bob b...@coolfone.comze.com

 Apparently, the Nexus 7 has no temperature sensor according to this method:

 private void attachToSensor() {
 SensorManager sensorManager = getSensorManager();
  ListSensor sensors =
 sensorManager.getSensorList(Sensor.TYPE_TEMPERATURE);
 if (sensors.size()  0) {
 Sensor sensor = sensors.get(0);
 sensorManager.registerListener(this, sensor,
 SensorManager.SENSOR_DELAY_FASTEST, handler);
 } else {
 Log.e(TAG, No temperature sensor found);
 }
 }

 Thanks.


 On Thursday, April 18, 2013 4:14:03 PM UTC-5, psyco wrote:

 am sure that the method that shows the needle is not called !!
 check your ondraw method


 2013/4/18 bob b...@coolfone.comze.com

 For some reason, that thermometer example doesn't seem to work right:


 https://lh4.googleusercontent.com/-TexVCcRcNGg/UXAygbVmnAI/AYk/7-4nLHQYVPQ/s1600/therm.png




 Thanks.

 On Thursday, April 18, 2013 11:13:37 AM UTC-5, Bilthon wrote:

 I found this nice tutorial about the subject: http://mindtherobot.**c**
 om/blog/272/android-custom-**ui-**making-a-vintage-**thermometer/http://mindtherobot.com/blog/272/android-custom-ui-making-a-vintage-thermometer/

 And based on that created this Speedometer: https://github.**co**
 m/bilthon/Android-**Speedometerhttps://github.com/bilthon/Android-Speedometer

 Both projects are very simple, but they demonstrate quite well how to
 create a custom view similar to the one you apparently want.

 Nelson


 On Wednesday, April 17, 2013 7:04:37 AM UTC-3, psyco wrote:

 hi all,



 https://lh4.googleusercontent.com/-4D0DiiIo5fQ/UW5zlODBo5I/ADU/wXMM1ppiHz4/s1600/thermometer_icon.pngam
 trying to build a custom view witch displays a gauge, what i did is :
 1-designed the gauge with photoshop
 2-created the cutom View and it's .XML file
 3-set the bakcground gauge
 So, i need to know how to display a needle and how rotating it
 some help will be very grateful

  --
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@**googlegroups.com

 To unsubscribe from this group, send email to
 android-developers+**unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit https://groups.google.com/d/**
 topic/android-developers/**CTlRkqPuBVI/unsubscribe?hl=enhttps://groups.google.com/d/topic/android-developers/CTlRkqPuBVI/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+**unsubscr...@googlegroups.com.
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .






 --
 Abdallah Mohamed Amine
 Élève ingénieur en informatique de la FST
 Responsable d'un club embarqué microdesign
 Tél : +216 27 105 393
  http://microdesignclub.com

  --
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/CTlRkqPuBVI/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
Abdallah Mohamed Amine
Élève ingénieur en informatique de la FST
Responsable d'un club embarqué microdesign
Tél : +216 27 105 393
http://microdesignclub.com

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: how to create a custom gauge in android

2013-04-18 Thread abdallah mouhamed amine
thank you bob

that's helping me a lot :)

let's code \m/

big up


2013/4/17 bob b...@coolfone.comze.com

 If you don't use *save*() and *restore*() and something gets drawn after
 your needle, it will also be rotated just as the needle was rotated.


 So you would probably use something like this:


 *canvas.save();*


 canvas.rotate(45, 100, 100);

 canvas.drawBitmap(…);


 *canvas.restore();*


 Thanks.




 On Wednesday, April 17, 2013 12:08:12 PM UTC-5, psyco wrote:

 thank you BOB that helps me a lot :)
 i used draw method to draw the needle (initial position) then i used
 rotate like you said to rotate it
 and it works correctly
 did i need to use save and restore methods?


 2013/4/17 bob b...@coolfone.comze.com

 Break the needle off of that image and put it in it's own image.

 Then use this function in *Canvas*:

 final void *rotate*(float degrees, float px, float py)

 Also, you will call *drawBitmap* in the Canvas class.

 Of course, you will want to *save()* and *restore()* the matrices
 before and after the rotation.

 Thanks.


 On Wednesday, April 17, 2013 5:04:37 AM UTC-5, psyco wrote:

 hi all,



 https://lh4.googleusercontent.com/-4D0DiiIo5fQ/UW5zlODBo5I/ADU/wXMM1ppiHz4/s1600/thermometer_icon.pngam
 trying to build a custom view witch displays a gauge, what i did is :
 1-designed the gauge with photoshop
 2-created the cutom View and it's .XML file
 3-set the bakcground gauge
 So, i need to know how to display a needle and how rotating it
 some help will be very grateful

  --
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-d...@**googlegroups.com

 To unsubscribe from this group, send email to
 android-developers+**unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/**group/android-developers?hl=enhttp://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit https://groups.google.com/d/**
 topic/android-developers/**CTlRkqPuBVI/unsubscribe?hl=enhttps://groups.google.com/d/topic/android-developers/CTlRkqPuBVI/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+**unsubscr...@googlegroups.com.
 For more options, visit 
 https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .






 --
 Abdallah Mohamed Amine
 Élève ingénieur en informatique de la FST
 Responsable d'un club embarqué microdesign
 Tél : +216 27 105 393
  http://microdesignclub.com

  --
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/CTlRkqPuBVI/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
Abdallah Mohamed Amine
Élève ingénieur en informatique de la FST
Responsable d'un club embarqué microdesign
Tél : +216 27 105 393
http://microdesignclub.com

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: how to create a custom gauge in android

2013-04-18 Thread Bilthon
I found this nice tutorial about the subject: 
http://mindtherobot.com/blog/272/android-custom-ui-making-a-vintage-thermometer/

And based on that created this Speedometer: 
https://github.com/bilthon/Android-Speedometer

Both projects are very simple, but they demonstrate quite well how to 
create a custom view similar to the one you apparently want.

Nelson


On Wednesday, April 17, 2013 7:04:37 AM UTC-3, psyco wrote:

 hi all,



 https://lh4.googleusercontent.com/-4D0DiiIo5fQ/UW5zlODBo5I/ADU/wXMM1ppiHz4/s1600/thermometer_icon.pngam
  
 trying to build a custom view witch displays a gauge, what i did is :
 1-designed the gauge with photoshop
 2-created the cutom View and it's .XML file 
 3-set the bakcground gauge
 So, i need to know how to display a needle and how rotating it 
 some help will be very grateful



-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: how to create a custom gauge in android

2013-04-18 Thread abdallah mouhamed amine
thank you Bilthon,
i build the custom view i want , i just used 3 drawable ( needle,
centerwheel and a background gauge)
with ondraw and rotate method
I tested it with my emulator and it's working correctly
thank you all for your help :D


2013/4/18 Bilthon bilt...@gmail.com

 I found this nice tutorial about the subject:
 http://mindtherobot.com/blog/272/android-custom-ui-making-a-vintage-thermometer/

 And based on that created this Speedometer:
 https://github.com/bilthon/Android-Speedometer

 Both projects are very simple, but they demonstrate quite well how to
 create a custom view similar to the one you apparently want.

 Nelson


 On Wednesday, April 17, 2013 7:04:37 AM UTC-3, psyco wrote:

 hi all,



 https://lh4.googleusercontent.com/-4D0DiiIo5fQ/UW5zlODBo5I/ADU/wXMM1ppiHz4/s1600/thermometer_icon.pngam
 trying to build a custom view witch displays a gauge, what i did is :
 1-designed the gauge with photoshop
 2-created the cutom View and it's .XML file
 3-set the bakcground gauge
 So, i need to know how to display a needle and how rotating it
 some help will be very grateful

  --
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/CTlRkqPuBVI/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
Abdallah Mohamed Amine
Élève ingénieur en informatique de la FST
Responsable d'un club embarqué microdesign
Tél : +216 27 105 393
http://microdesignclub.com

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: how to create a custom gauge in android

2013-04-18 Thread bob
 

For some reason, that thermometer example doesn't seem to work right:

https://lh4.googleusercontent.com/-TexVCcRcNGg/UXAygbVmnAI/AYk/7-4nLHQYVPQ/s1600/therm.png




Thanks.

On Thursday, April 18, 2013 11:13:37 AM UTC-5, Bilthon wrote:

 I found this nice tutorial about the subject: 
 http://mindtherobot.com/blog/272/android-custom-ui-making-a-vintage-thermometer/

 And based on that created this Speedometer: 
 https://github.com/bilthon/Android-Speedometer

 Both projects are very simple, but they demonstrate quite well how to 
 create a custom view similar to the one you apparently want.

 Nelson


 On Wednesday, April 17, 2013 7:04:37 AM UTC-3, psyco wrote:

 hi all,



 https://lh4.googleusercontent.com/-4D0DiiIo5fQ/UW5zlODBo5I/ADU/wXMM1ppiHz4/s1600/thermometer_icon.pngam
  
 trying to build a custom view witch displays a gauge, what i did is :
 1-designed the gauge with photoshop
 2-created the cutom View and it's .XML file 
 3-set the bakcground gauge
 So, i need to know how to display a needle and how rotating it 
 some help will be very grateful



-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: how to create a custom gauge in android

2013-04-18 Thread abdallah mouhamed amine
am sure that the method that shows the needle is not called !!
check your ondraw method


2013/4/18 bob b...@coolfone.comze.com

 For some reason, that thermometer example doesn't seem to work right:


 https://lh4.googleusercontent.com/-TexVCcRcNGg/UXAygbVmnAI/AYk/7-4nLHQYVPQ/s1600/therm.png




 Thanks.

 On Thursday, April 18, 2013 11:13:37 AM UTC-5, Bilthon wrote:

 I found this nice tutorial about the subject: http://mindtherobot.**
 com/blog/272/android-custom-**ui-making-a-vintage-**thermometer/http://mindtherobot.com/blog/272/android-custom-ui-making-a-vintage-thermometer/

 And based on that created this Speedometer: https://github.**
 com/bilthon/Android-**Speedometerhttps://github.com/bilthon/Android-Speedometer

 Both projects are very simple, but they demonstrate quite well how to
 create a custom view similar to the one you apparently want.

 Nelson


 On Wednesday, April 17, 2013 7:04:37 AM UTC-3, psyco wrote:

 hi all,



 https://lh4.googleusercontent.com/-4D0DiiIo5fQ/UW5zlODBo5I/ADU/wXMM1ppiHz4/s1600/thermometer_icon.pngam
 trying to build a custom view witch displays a gauge, what i did is :
 1-designed the gauge with photoshop
 2-created the cutom View and it's .XML file
 3-set the bakcground gauge
 So, i need to know how to display a needle and how rotating it
 some help will be very grateful

  --
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/CTlRkqPuBVI/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
Abdallah Mohamed Amine
Élève ingénieur en informatique de la FST
Responsable d'un club embarqué microdesign
Tél : +216 27 105 393
http://microdesignclub.com

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: how to create a custom gauge in android

2013-04-18 Thread bob
Apparently, the Nexus 7 has no temperature sensor according to this method:

private void attachToSensor() {
SensorManager sensorManager = getSensorManager();
 ListSensor sensors = 
sensorManager.getSensorList(Sensor.TYPE_TEMPERATURE);
if (sensors.size()  0) {
Sensor sensor = sensors.get(0);
sensorManager.registerListener(this, sensor, 
SensorManager.SENSOR_DELAY_FASTEST, handler);
} else {
Log.e(TAG, No temperature sensor found);
} 
}

Thanks.


On Thursday, April 18, 2013 4:14:03 PM UTC-5, psyco wrote:

 am sure that the method that shows the needle is not called !!
 check your ondraw method 


 2013/4/18 bob b...@coolfone.comze.com javascript:

 For some reason, that thermometer example doesn't seem to work right:


 https://lh4.googleusercontent.com/-TexVCcRcNGg/UXAygbVmnAI/AYk/7-4nLHQYVPQ/s1600/therm.png




 Thanks.

 On Thursday, April 18, 2013 11:13:37 AM UTC-5, Bilthon wrote:

 I found this nice tutorial about the subject: http://mindtherobot.**
 com/blog/272/android-custom-**ui-making-a-vintage-**thermometer/http://mindtherobot.com/blog/272/android-custom-ui-making-a-vintage-thermometer/

 And based on that created this Speedometer: https://github.**
 com/bilthon/Android-**Speedometerhttps://github.com/bilthon/Android-Speedometer

 Both projects are very simple, but they demonstrate quite well how to 
 create a custom view similar to the one you apparently want.

 Nelson


 On Wednesday, April 17, 2013 7:04:37 AM UTC-3, psyco wrote:

 hi all,



 https://lh4.googleusercontent.com/-4D0DiiIo5fQ/UW5zlODBo5I/ADU/wXMM1ppiHz4/s1600/thermometer_icon.pngam
  
 trying to build a custom view witch displays a gauge, what i did is :
 1-designed the gauge with photoshop
 2-created the cutom View and it's .XML file 
 3-set the bakcground gauge
 So, i need to know how to display a needle and how rotating it 
 some help will be very grateful

  -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to 
 android-d...@googlegroups.comjavascript:
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/android-developers/CTlRkqPuBVI/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to 
 android-developers+unsubscr...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  




 -- 
 Abdallah Mohamed Amine
 Élève ingénieur en informatique de la FST
 Responsable d'un club embarqué microdesign
 Tél : +216 27 105 393
  http://microdesignclub.com
  

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[android-developers] Re: how to create a custom gauge in android

2013-04-17 Thread bob
Break the needle off of that image and put it in it's own image.

Then use this function in *Canvas*:

final void *rotate*(float degrees, float px, float py)

Also, you will call *drawBitmap* in the Canvas class.

Of course, you will want to *save()* and *restore()* the matrices before 
and after the rotation.

Thanks.


On Wednesday, April 17, 2013 5:04:37 AM UTC-5, psyco wrote:

 hi all,



 https://lh4.googleusercontent.com/-4D0DiiIo5fQ/UW5zlODBo5I/ADU/wXMM1ppiHz4/s1600/thermometer_icon.pngam
  
 trying to build a custom view witch displays a gauge, what i did is :
 1-designed the gauge with photoshop
 2-created the cutom View and it's .XML file 
 3-set the bakcground gauge
 So, i need to know how to display a needle and how rotating it 
 some help will be very grateful



-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: how to create a custom gauge in android

2013-04-17 Thread abdallah mouhamed amine
thank you BOB that helps me a lot :)
i used draw method to draw the needle (initial position) then i used rotate
like you said to rotate it
and it works correctly
did i need to use save and restore methods?


2013/4/17 bob b...@coolfone.comze.com

 Break the needle off of that image and put it in it's own image.

 Then use this function in *Canvas*:

 final void *rotate*(float degrees, float px, float py)

 Also, you will call *drawBitmap* in the Canvas class.

 Of course, you will want to *save()* and *restore()* the matrices before
 and after the rotation.

 Thanks.


 On Wednesday, April 17, 2013 5:04:37 AM UTC-5, psyco wrote:

 hi all,



 https://lh4.googleusercontent.com/-4D0DiiIo5fQ/UW5zlODBo5I/ADU/wXMM1ppiHz4/s1600/thermometer_icon.pngam
 trying to build a custom view witch displays a gauge, what i did is :
 1-designed the gauge with photoshop
 2-created the cutom View and it's .XML file
 3-set the bakcground gauge
 So, i need to know how to display a needle and how rotating it
 some help will be very grateful

  --
 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/android-developers/CTlRkqPuBVI/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to
 android-developers+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
Abdallah Mohamed Amine
Élève ingénieur en informatique de la FST
Responsable d'un club embarqué microdesign
Tél : +216 27 105 393
http://microdesignclub.com

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [android-developers] Re: how to create a custom gauge in android

2013-04-17 Thread bob
 

If you don't use *save*() and *restore*() and something gets drawn after 
your needle, it will also be rotated just as the needle was rotated.


So you would probably use something like this:


*canvas.save();*


canvas.rotate(45, 100, 100);

canvas.drawBitmap(…);


*canvas.restore();*


Thanks.




On Wednesday, April 17, 2013 12:08:12 PM UTC-5, psyco wrote:

 thank you BOB that helps me a lot :)
 i used draw method to draw the needle (initial position) then i used 
 rotate like you said to rotate it
 and it works correctly
 did i need to use save and restore methods?


 2013/4/17 bob b...@coolfone.comze.com javascript:

 Break the needle off of that image and put it in it's own image.

 Then use this function in *Canvas*:

 final void *rotate*(float degrees, float px, float py)

 Also, you will call *drawBitmap* in the Canvas class.

 Of course, you will want to *save()* and *restore()* the matrices before 
 and after the rotation.

 Thanks.


 On Wednesday, April 17, 2013 5:04:37 AM UTC-5, psyco wrote:

 hi all,



 https://lh4.googleusercontent.com/-4D0DiiIo5fQ/UW5zlODBo5I/ADU/wXMM1ppiHz4/s1600/thermometer_icon.pngam
  
 trying to build a custom view witch displays a gauge, what i did is :
 1-designed the gauge with photoshop
 2-created the cutom View and it's .XML file 
 3-set the bakcground gauge
 So, i need to know how to display a needle and how rotating it 
 some help will be very grateful

  -- 
 -- 
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to 
 android-d...@googlegroups.comjavascript:
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com javascript:
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en
 --- 
 You received this message because you are subscribed to a topic in the 
 Google Groups Android Developers group.
 To unsubscribe from this topic, visit 
 https://groups.google.com/d/topic/android-developers/CTlRkqPuBVI/unsubscribe?hl=en
 .
 To unsubscribe from this group and all its topics, send an email to 
 android-developers+unsubscr...@googlegroups.com javascript:.
 For more options, visit https://groups.google.com/groups/opt_out.
  
  




 -- 
 Abdallah Mohamed Amine
 Élève ingénieur en informatique de la FST
 Responsable d'un club embarqué microdesign
 Tél : +216 27 105 393
  http://microdesignclub.com
  

-- 
-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
Android Developers group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.