Hello everyone,

i passed the whole journey trying to make this function, without success

Code:
public function scalePic (inP as StdPicture, x as long, y as long ) as StdPicture
i need to rescale the StdPicture object without passing throug a picturebox control

All I can do now is :

just to be clear , I can do it that way :

1. Load image and generate a dc
Code:
    Dim DC As Long, picTemp As IPictureDisp
    DC = CreateCompatibleDC(0)
    If DC < 1 Then Exit Function
    Set picTemp = LoadPicture("c:\test.jpg")
    picWidth = ScaleX(picTemp.Width)
    picHeight = ScaleY(picTemp.Height)
    SelectObject DC, picTemp
2. Scaling the image into an imagebox

Code:
    StretchBlt Picture1.hdc, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight, picDc, 0, 0, picWidth, picHeight, vbSrcCopy
    Picture1.Refresh
3. Load the picture from the picturebox:

Code:
Dim p As StdPicture   
Set p = Picture1.Picture
Then i have a function to save the StdPicture object to jpg file

The problem here is that i dont want to use a picturebox in my application, and i can't make the StretchBlt API work without using a picturebox as dest handle

declaration:
Code:
Declare Function StretchBlt Lib "gdi32.dll" ( _
        ByVal hDC As Long, ByVal X As Long, ByVal Y As Long, _
        ByVal nWidth As Long, ByVal nHeight As Long, _
        ByVal hSrcDC As Long, ByVal XSrc As Long, _
        ByVal YSrc As Long, ByVal nSrcWidth As Long, _
        ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
any idea