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

Drawing a stamp

More
IP: 192.168.0.71 8 years 6 months ago #12844 by doubleeye
Drawing a stamp was created by doubleeye
How do I draw a stamp programatically?

on the PDFLayoutView I tried to use the following

// start drawing stamp
PDFSetStamp(0);


// programatically create stamp, using code from onDrawStamp()
if (m_status == STA_STAMP && canvas != null) {
if (m_icon != null) {
Rect rc = new Rect();
rc.left = left;
rc.top = top;
rc.right = right;
rc.bottom = bottom;

// crash here <<<<<<<<<<<<<
canvas.drawBitmap(m_icon, null, rc, null);

}
}

// end
PDFSetStamp(1);


the canvas i get here
public void OnPageDisplayed(Canvas canvas, VPage vpage) {
this.canvas = canvas;
this.vpage = vpage;
}

Please advise, drawing a selection using this canvas seems to work fine.
More
IP: 192.168.0.71 8 years 6 months ago #12850 by nermeen
Replied by nermeen on topic Drawing a stamp
It's not clear what is the cause of the crash, but i advice you to get the canvas from PDFLayoutView.onDraw(Canvas canvas)
instead of OnPageDisplayed (as this is a callback that gets called based on conditions)

If you still have problems, can you send us the whole modified PDFLayoutView class so we can test it.
Time to create page: 0.412 seconds
Powered by Kunena Forum