Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Image Resizing in Win32... (Real Studio Plugins Mailinglist archive)

Back to the thread list
Previous thread: AppleScript on CodeWarrior
Next thread: CodeWarrior vs Xcode

macosx and unix paths   -   GOLD
  Image Resizing in Win32...   -   Suikyo

Image Resizing in Win32...
Date: 08.06.05 05:52 (Wed, 08 Jun 2005 13:52:16 +0900)
From: Suikyo
This is topics in relative in "REALGraphicsDC does not work any more".

How should I do to reduce the image by using GDI?
---------------------------- code ---------------------------
REALpicture modThumbnail(REALpicture instance,int width,int height)
REALpictureDescription srcDesc;

//Get original-picture peroperty
REALgraphics srcGraphics = REALGetPictureGraphics(instance);
HDC srcDC = REALGraphicsDC(srcGraphics);
REALLockPictureDescription(instance, &srcDesc);
int srcWidth = srcDesc.width;
int srcHeight = srcDesc.height;
int srcDepth = srcDesc.depth;

REALpicture memPicture = REALNewPicture( width, height, 32 );
REALgraphics memGraphics = REALGetPictureGraphics( memPicture );
HDC memDC = REALGraphicsDC( memGraphics );

#ifdef UseInternalDraw
::Rect rBounds;
//It works fine. but it is nearest-neighber algorithm.
REALDrawPicturePrimitive( memDC, instance, &rBounds, false );
return memPicture;
//set stretch mode. No error.
DebugMessage("Failed : SetStretchBltMode");return nil;
//Return Brush Pos. No error.
DebugMessage("Failed : SetBrushOrgEx");return nil;
//Execute StretchBlt. Show Message "Failed..."
srcDC,0,0,srcWidth,srcHeight,SRCCOPY) =OULL ){
DebugMessage("Failed : StretchBlt");
return nil;
return memPicture;
Unsubscribe or switch delivery mode:

Search the archives of this list here: