Display JPEG pics in reportcontrol preview mode |
Post Reply |
Author | |
unknow
Groupie Joined: 14 January 2009 Location: Belgium Status: Offline Points: 62 |
Post Options
Thanks(0)
Posted: 05 October 2010 at 6:56pm |
Hi there;
I'm looking for a way to display a small jpeg picture for each report control row, either in regular mode but more in the preview mode.
I'm not looking for an icon from resources, but a real jpeg picture loaded from disk; possibly a size large enough like 64x64 or 100x100;
How can this be achieved ??
Thanks;)
|
|
unknow
Groupie Joined: 14 January 2009 Location: Belgium Status: Offline Points: 62 |
Post Options
Thanks(0)
|
Hi, just a little bump ; please no one has a hint on how to do this ? Is it a possible enhancement request ?
Thankx.
|
|
Marco1
Senior Member Joined: 16 January 2004 Location: Germany Status: Offline Points: 251 |
Post Options
Thanks(0)
|
I don't know what you mean with "preview mode".
Drawing a JPEG in a report cell is not a big problem. Look at the CJ example "ReportControl.CustomDrawReport". In this example you see, how to custom draw a cell. Then you create your own CXTPCustomDrawReportPaintManager and override GetRowHeight to return your desired row (picture) height. To draw the bitmap, you create your own CXTPReportRecordItem (CReportRecordItemBitmap here) and override OnDrawCaption, do something (simplyfied) like this: void CReportRecordItemBitmap::OnDrawCaption(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pMetrics) { if (!(pDrawArgs && pMetrics)) return; // draw bitmap CDC memDC; memDC.CreateCompatibleDC(pDrawArgs->pDC); CBitmap *pOldbmp = memDC.SelectObject(&m_bitmap); if (!m_bitmap.m_hObject) { return; } BITMAP bi; m_bitmap.GetBitmap(&bi); // ... calculate image size here pDrawArgs->pDC->SetStretchBltMode(COLORONCOLOR); pDrawArgs->pDC->StretchBlt(... , &memDC, 0, 0, ..., ..., SRCCOPY); memDC.SelectObject(pOldbmp); } That's it. |
|
unknow
Groupie Joined: 14 January 2009 Location: Belgium Status: Offline Points: 62 |
Post Options
Thanks(0)
|
Thanks for the hints ;)
Here's what I'd like to achieve:
1: Display a bmp/gif/jpeg/png loaded from disk within column/rows (each row different bitmap) of the reportcontrol, for example to insert a preview of the picture file within the report control
2: load a bitmap from resources (used in the software as an ImageList) to display 32x32 pix icons instead of the small 16x16 from the ImageList.
Is there additional code to modify (except for loading and converting the bitmap) ?
thankx;
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |