Bueno, creo que eres el mismo de la pregunta que ya respondí.
Lo que necesitas es crear un CompatibleDevice con api del windows, para escalar la imágen antes de asignar a tu control.
En Gdi32.lib tienes funciones api para el manejo de mapas de bits
BOOL GetBitmapDimensionEx(
HBITMAP hBitmap, // handle to bitmap
LPSIZE lpDimension // dimensions
);
typedef struct tagSIZE {
LONG cx;
LONG cy;
} SIZE, *PSIZE;
hBitmap debe ser un handle a un bitmap, que puedes crear con otras funciones de API
Por ejemplo con esta función
HBITMAP LoadBitmap(
HINSTANCE hInstance, // handle to application instance
LPCTSTR lpBitmapName // name of bitmap resource
);
Ahora. para escalar la imágen, haces esto (sacado de MSDN de Microsoft) :
hdcScaled = CreateCompatibleDC(hdcScreen);
hbmScaled = CreateCompatibleBitmap(hdcScreen,
GetDeviceCaps(hdcScreen, HORZRES) * 2,
GetDeviceCaps(hdcScreen, VERTRES) * 2);
if (hbmScaled == 0)
errhandler("hbmScaled", hwnd);
// Select the bitmaps into the compatible DC.
if (!SelectObject(hdcScaled, hbmScaled))
errhandler("Scaled Bitmap Selection", hwnd);
case WM_COMMAND: // message: command from application menu
switch(wParam)
{
case IDM_SCALEX1:
if (fBlt)
{
fScaled = FALSE;
hdcWin = GetDC(hwnd);
BitBlt(hdcWin,
0,0,
bmp.bmWidth, bmp.bmHeight,
hdcCompatible,
0,0,
SRCCOPY);
ReleaseDC(hwnd, hdcWin);
}
break;
case IDM_SCALEX2:
if (fBlt)
{
fScaled = TRUE;
StretchBlt(hdcScaled,
0, 0,
bmp.bmWidth * 2, bmp.bmHeight * 2,
hdcCompatible,
0, 0,
bmp.bmWidth, bmp.bmHeight,
SRCCOPY);
hdcWin = GetDC(hwnd);
BitBlt(hdcWin,
0,0,
bmp.bmWidth, bmp.bmHeight,
hdcScaled,
0,0,
SRCCOPY);
ReleaseDC(hwnd, hdcWin);
}
break;
Esto lo puedes implementar llamando a todas estas api desde powerbuilder o bien en una librería en C o C++
EL WM_* es un evento en powerbuilder. tienes que repintar la imágen cada vez que se hace un resize del layout (tu ventana)
y en el evento paint
Suerte.