Click here to Skip to main content
15,895,529 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to find the memory usage programatically? Pin
appuanbu5-Aug-05 5:01
appuanbu5-Aug-05 5:01 
AnswerRe: How to find the memory usage programatically? Pin
Blake Miller5-Aug-05 6:09
Blake Miller5-Aug-05 6:09 
GeneralRe: How to find the memory usage programatically? Pin
appuanbu5-Aug-05 6:18
appuanbu5-Aug-05 6:18 
GeneralRe: How to find the memory usage programatically? Pin
Blake Miller8-Aug-05 6:26
Blake Miller8-Aug-05 6:26 
Generalcall graph Pin
jaycush5-Aug-05 4:57
jaycush5-Aug-05 4:57 
GeneralRe: call graph Pin
RChin5-Aug-05 5:16
RChin5-Aug-05 5:16 
GeneralRe: call graph Pin
jaycush5-Aug-05 5:30
jaycush5-Aug-05 5:30 
GeneralGDI+ stretching Pin
lroels5-Aug-05 4:56
lroels5-Aug-05 4:56 
I wrote a simple DLL to smoothly stretch a supplied GDI HBITMAP using the GDI+ bilinear stretch algorithm. ( since GDI stretchblit with halftone is not good enough ) The Dll stretch function uses the drawimage command to write the stretched image directly to the device context of a window in another process. This works fine but it seems the drawimage command sends WM_NCPAINT and WM_ERASEBKGND messages to that window which causes flickering!!!

I could stretch to a memory device context and then bitblit the contents of the memory device context to the window, but the extra bitblt causes an unacceptable increase in CPU processing power.

Another solution would require injecting code into the other process to be able to subclass the window handler but this seems complex and may make the application susceptable to crashes.

Is there a simpler solution??? Any ideas or c++ source code of an image stretch routine with the same quality and speed of the gdiplus bilinear stretch?


VSKSTRETCH_API int WINAPI fnGdiPlusStretch(HBITMAP hBitmap,HDC hDest,int iXpos,int iYpos,int iWidth,int iHeight)
{
Bitmap* pBitMap = NULL;
CPalette Palette;


// +------------+
// | Gdi+ stuff |
// +------------+

HPALETTE hPalette = (HPALETTE)GetCurrentObject( hDest, OBJ_PAL) ;
//Palette.CreateHalftonePalette(hDest);

pBitMap = Bitmap::FromHBITMAP(hBitmap, (HPALETTE)Palette);

Graphics graphics(hDest); // Create Graphics object

graphics.SetInterpolationMode(InterpolationModeBilinear);

graphics.DrawImage(pBitMap,iXpos,iYpos,iWidth,iHeight);

delete pBitMap;
pBitMap = NULL;

return 0;
}

QuestionWIN32 API question: WNDCLASS.cbWndExtra ? Pin
Anonymous5-Aug-05 4:33
Anonymous5-Aug-05 4:33 
AnswerRe: WIN32 API question: WNDCLASS.cbWndExtra ? Pin
Blake Miller5-Aug-05 6:13
Blake Miller5-Aug-05 6:13 
AnswerRe: WIN32 API question: WNDCLASS.cbWndExtra ? Pin
Blake Miller5-Aug-05 6:14
Blake Miller5-Aug-05 6:14 
QuestionAbout Word Addin of adding a bmp? Pin
sharkmouse5-Aug-05 3:14
sharkmouse5-Aug-05 3:14 
GeneralDynamic Arrays...... Pin
Raza56805-Aug-05 3:10
Raza56805-Aug-05 3:10 
GeneralRe: Dynamic Arrays...... Pin
ThatsAlok5-Aug-05 3:14
ThatsAlok5-Aug-05 3:14 
GeneralRe: Dynamic Arrays...... Pin
Bob Stanneveld5-Aug-05 3:44
Bob Stanneveld5-Aug-05 3:44 
GeneralRe: Dynamic Arrays...... Pin
Roland Pibinger5-Aug-05 8:43
Roland Pibinger5-Aug-05 8:43 
QuestionTo get message from Windows if user writes on hard disk? Pin
sannik5-Aug-05 2:07
sannik5-Aug-05 2:07 
AnswerRe: To get message from Windows if user writes on hard disk? Pin
koothkeeper5-Aug-05 3:24
professionalkoothkeeper5-Aug-05 3:24 
GeneralCPropertyPage's caption Pin
LiYS5-Aug-05 1:31
LiYS5-Aug-05 1:31 
GeneralRe: CPropertyPage's caption Pin
eli150219795-Aug-05 1:42
eli150219795-Aug-05 1:42 
GeneralRe: CPropertyPage's caption Pin
LiYS5-Aug-05 4:34
LiYS5-Aug-05 4:34 
GeneralRe: CPropertyPage's caption Pin
Marc Soleda5-Aug-05 4:47
Marc Soleda5-Aug-05 4:47 
GeneralRe: CPropertyPage's caption Pin
LiYS5-Aug-05 20:16
LiYS5-Aug-05 20:16 
GeneralRe: CPropertyPage's caption Pin
Marc Soleda7-Aug-05 20:42
Marc Soleda7-Aug-05 20:42 
QuestionHow to ignore the style of colspan of tablecells? Pin
123ivan1235-Aug-05 1:26
123ivan1235-Aug-05 1:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.