Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about Android development and PDF

Eraser of PDF Ink

More
IP: 192.168.0.70 12 years 2 months ago #4865 by el3ony
Eraser of PDF Ink was created by el3ony
Hi,

Is there a way how to make an eraser? After I painted any color on PDF I don't know how to paint the transparency color to erase the ink that I painted before.

I already tried with these snippet code but it doesn't work

paint.setColor(Color.TRANSPARENT);
paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));


any reply would be appreciate
More
IP: 192.168.0.70 12 years 2 months ago #4866 by radaee
Replied by radaee on topic Eraser of PDF Ink
delete the Ink object.
if Ink object not added to page by Page.AddAnnotInk().
just invoke Ink.destroy(), and set Ink object to null.

if Ink objecy was added to page.
then invoke Annotation.RemoveFromPage() or Annotation.SetHide()
More
IP: 192.168.0.70 12 years 2 months ago #4867 by el3ony
Replied by el3ony on topic Eraser of PDF Ink
Thanks but this is not what I want

Ink.destroy(), and set Ink object to null
Annotation.RemoveFromPage(), Annotation.SetHide()

These code uses for remove all of the Ink object but I want to remove some part of the ink object,
in this case the rubber to rub some part of the Ink.
More
IP: 192.168.0.70 12 years 2 months ago #4868 by radaee
Replied by radaee on topic Eraser of PDF Ink
i think, in this case.
you can create your owner Ink class to descript editable cache.

and the Ink class(you defined) can translate to Ink(com.radaee.pdf.Ink).
then add translated Ink object to Page, if needed.
More
IP: 192.168.0.70 12 years 2 months ago #4869 by radaee
Replied by radaee on topic Eraser of PDF Ink
an other way is:
create a Bitmap object over page, when Ink drawn.
and eraser write transparent color to Bitmap object for coordinate(not draw, but set pixels value).

after all, then clip bonding box to all object, and get a smaller bitmap object.
then add the bitmap object to page by Page.AddAnnotBitmap or Page.AddContent
More
IP: 192.168.0.70 12 years 2 months ago #4870 by el3ony
Replied by el3ony on topic Eraser of PDF Ink
Thank I'll try and get back to you.
Time to create page: 0.365 seconds
Powered by Kunena Forum