Re: [android-developers] drawBitmapMesh

2013-03-08 Thread bob
Is this what you want?

http://www.java2s.com/Code/Android/2D-Graphics/BitmapMesh.htm

Also, you can always use FishEye GLSL code.

It's in the HelloEffects sample:




On Friday, March 8, 2013 12:29:10 PM UTC-6, A N K ! T wrote:
>
> Have you able to do this?
>
>
> On Sun, Feb 20, 2011 at 11:41 AM, lori...@gmail.com  <
> lori...@gmail.com > wrote:
>
>> Hi,
>>
>> I want to apply a bulge effect on my image using a circular brush. I
>> found a useful method drawBitmapMesh using which I can define a mesh
>> and apply the warp effect.
>>
>> But I'm not sure how to define a bulge effect. Can anyone please help?
>>
>> --
>> 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=en
>
>
>
>
> -- 
> Thanks & Regards,
> Ankit Awasthi 
>  

-- 
-- 
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] drawBitmapMesh

2013-03-08 Thread A N K ! T
Have you able to do this?


On Sun, Feb 20, 2011 at 11:41 AM, loril...@gmail.com wrote:

> Hi,
>
> I want to apply a bulge effect on my image using a circular brush. I
> found a useful method drawBitmapMesh using which I can define a mesh
> and apply the warp effect.
>
> But I'm not sure how to define a bulge effect. Can anyone please help?
>
> --
> 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




-- 
Thanks & Regards,
Ankit Awasthi

-- 
-- 
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] drawBitmapMesh

2011-02-19 Thread loril...@gmail.com
Hi,

I want to apply a bulge effect on my image using a circular brush. I
found a useful method drawBitmapMesh using which I can define a mesh
and apply the warp effect.

But I'm not sure how to define a bulge effect. Can anyone please help?

-- 
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


[android-developers] drawBitmapMesh: How to draw a bitmap transformed to fit a shape?

2010-07-02 Thread droidful
Hi,

I want to draw a bitmap into a shape (in this case an isosceles
trapezoid); not clipped, but with the bitmap transformed to fit the
shape. For example, if the height of the left side is greater than
that of the right side then I want the bitmap evenly transformed in
height from left to right to match the height difference. The only
method I can find to do this is drawBitmapMesh, however this produces
some strange results. I have searched extensively and can find no
concrete information on drawBitmapMesh.

To demonstrate the example, I have a bitmap which contains an even
grid of vertical and horizontal lines. I use bitmap mesh with the code
shown below. However, the horizontal lines of the grid do not evenly
merge downwards from the top and upwards from the bottom towards the
target. Rather, horizontal lines to the left of the line dissecting
the top-left to bottom-right diagonal of the shape slant downwards to
the left, lines to the right of the same diagonal slant downwards to
the right. I also note that that the top line of the bitmap increases
slightly in height from left before descending again to the right.

Perhaps drawBitmapMesh is not the method I should be using, or perhaps
I am using it incorrectly. If anyone could enlighten me on how to
accomplish my aim I would be most grateful.

@Override
protected void dispatchDraw(Canvas canvas)
{
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
R.drawable.grid_bitmap);

Rect rect = new Rect();
this.getDrawingRect(rect);

float[] verts = new float[8];
verts[0] = rect.left;
verts[1] = rect.top;
verts[2] = rect.right;
verts[3] = rect.top + 100;

verts[4] = rect.left;
verts[5] = rect.bottom;
verts[6] = rect.right;
verts[7] = rect.bottom - 100;

canvas.drawBitmapMesh(bitmap, 1, 1, verts, 0, null, 0, null);
}

-- 
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