@Override
protected void onDraw(final Canvas canvas) {
if ((canvas.getClipBounds().width() > 0)
&& (canvas.getClipBounds().height() > 0)) {
PageContents page = getPageContents();
if (page != null) {
int restore = canvas.save();

canvas.scale(m_Scale, m_Scale);

page.drawBackground(canvas);

if ((page.m_Annotations != null)
&& (page.m_Annotations.size() > 0)) {
// The canvas needs to be rotated like the page when it's
// painted
RotationInfo rotInfo = getPageRotationInfo(m_PDFPage
.getPageRotation(), m_PDFPage.getCropBox().width(),
m_PDFPage.getCropBox().height());
canvas.concat(rotInfo.m_XForm);
canvas.translate(-m_PDFPage.getDisplayX(), -m_PDFPage
.getDisplayY());

for (Annotation annot : page.m_Annotations) {
// Save canvas state
int sCount = canvas.save();

// Translate to the annotation's origin
RectF annotRect = annot.getRectangle(); <- getting error here,
annot.getRectangle() not recognizeing
canvas.translate(annotRect.left, annotRect.top);

// Paint the annotation
annot.paint(canvas, false);

// Restore canvas state
canvas.restoreToCount(sCount);
}
}

canvas.restoreToCount(restore);

// draw a dark grey border around the page
Paint paint = new Paint();
paint.setColor(Color.rgb(150, 150, 150));
paint.setStrokeWidth(1f);
paint.setStyle(Style.STROKE);
canvas.drawRect(new RectF(.5f, .5f, getWidth() - .5f,
getHeight() - .5f), paint);
}
}
}
-- 
Thanks & Regards

Rakesh Kumar Jha
Android Developer, Trainer and Mentor
Bangalore
(O) +918030274295
(R) +919886336619

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

Reply via email to