drawing a png/jpeg image on the canvas

Problems with Canvas, OpenGL, etc...

drawing a png/jpeg image on the canvas

Postby Spomega » Sat Jun 26, 2010 1:38 pm

I am tryn to draw a png image on a canvas and z not working
Spomega
Freshman
Freshman
 
Posts: 6
Joined: Sat Jun 26, 2010 1:20 pm

Top

Re: drawing a png/jpeg image on the canvas

Postby UrbanLegend » Sat Jun 26, 2010 2:05 pm

simply :
Code: Select all
protected void onDraw(Canvas canvas) {
  Bitmap eBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.yourFileNameHere) ;
  canvas.drawBitmap(eBitmap ,0,0,  null) ;
}
UrbanLegend
Freshman
Freshman
 
Posts: 4
Joined: Sun Jun 20, 2010 9:59 pm

Re: drawing a png/jpeg image on the canvas

Postby Spomega » Sat Jul 10, 2010 5:42 pm

thanx man i ll give it a try
Spomega
Freshman
Freshman
 
Posts: 6
Joined: Sat Jun 26, 2010 1:20 pm

Re: drawing a png/jpeg image on the canvas

Postby Spomega » Sat Jul 17, 2010 3:03 pm

Can u also help me create a bitmap from an inputstream am trying onre and z not working
Spomega
Freshman
Freshman
 
Posts: 6
Joined: Sat Jun 26, 2010 1:20 pm

Top

Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 6 guests