|
|
|
|
Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
jb lee
|
Apr 6, 2005 - 11:35 AM
|
Please help me. I’m new to prof-uis. Is it possible to make a preview window ( control-bar or any UI ) for the image in the CExtImageEditWnd derived class? Prof-UI is excellent choice for me? Thanks!
|
|
Technical Support
|
Apr 8, 2005 - 3:44 AM
|
Yes, you can use the CExtImageEditWnd window as an image viewer only. Just create it with the __EIEDWS_READONLY style to disable editing.
You asked whether Prof-UIS is a good choice for you. You need to decide this yourself. Take a look at sample applications and read the forum messages.
|
|
jb lee
|
Apr 17, 2005 - 8:31 AM
|
Oups, sorry, I don’t mean it. I mean two window : the one is for editing, and the other is for preview. Preview window is smaller than editor window, and when the content of editing window changes, the preview window is updated.
|
|
Technical Support
|
Apr 18, 2005 - 11:36 AM
|
It’s quite easy. Please use your own CExtImageEditWnd -derived class and override the IedUndo() virtual method like as follows:INT C_YOUR_ImageEditWnd::IedUndo( INT nSteps )
{
ASSERT_VALID( this );
INT nRetVal = CExtImageEditWnd::IedUndo( nSteps );
_SyncViewerSurface();
return nRetVal;
} The _SyncViewerSurface() helper method of your image editor class should look like:void C_YOUR_ImageEditWnd::_SyncViewerSurface()
{
ASSERT_VALID( this );
if( IedIsEmpty() )
return;
HBITMAP hBitmap = IedBitmapGet();
if( hBitmap == NULL )
{
ASSERT( FALSE );
return;
}
COLORREF * pClrSurface = NULL;
hBitmap =
CExtPaintManager::stat_CloneBitmap(
hBitmap,
NULL,
&pClrSurface
);
if( hBitmap == NULL )
{
ASSERT( FALSE );
return;
}
ASSERT( pClrSurface != NULL );
COLORREF clrTransparent = IedGetTransparencyColor();
if( clrTransparent != ((COLORREF)(-1L)) )
{
COLORREF clrQuadTransparent =
RGB(
GetBValue(clrTransparent),
GetGValue(clrTransparent),
GetRValue(clrTransparent)
);
CSize _sizeImg = IedSizeGet();
LONG nPixelCount = _sizeImg.cx * _sizeImg.cy;
for( LONG nPixel = 0; nPixel < nPixelCount; nPixel++ )
pClrSurface[nPixel] = clrQuadTransparent;
CDC dc;
if( dc.CreateCompatibleDC( NULL ) )
{
HGDIOBJ hBmpOld = ::SelectObject( dc, hBitmap );
IedRender( dc );
::SelectObject( dc, hBmpOld );
} // if( dc.CreateCompatibleDC( NULL ) )
#ifdef _DEBUG
else
{
ASSERT( FALSE );
} // else from if( dc.CreateCompatibleDC( NULL ) )
#endif // _DEBUG
} // if( clrTransparent != ((COLORREF)(-1L)) )
CExtImageEditWnd * pWndIconViewer =
. . .
ASSERT_VALID( pWndIconViewer );
pWndIconViewer->IedBitmapSet( hBitmap );
}
|
|
jb lee
|
Apr 26, 2005 - 1:31 AM
|
Thank you so much! I’ll try it.
|
|