Hi, firstly thank you for your amazing code.

I am facing a issue when printing an image.
The code uses the same routines to draw either in the screen or in printer.
It uses the vb scale methods of own each object (picturebox or printer) to define de position given in millimeters.
However the render method of AIC just prints near the right position when I use the same coordinates used in the picturebox and add a magical offset (27 pixels horizontal and 43 pixels vertical)
More over the image was trimmed in the rendering.
The image was loaded from a byte array read from a data base field.

Code:
        Set myImg = New GDIpImage
        myImg.KeepOriginalFormat = False
        Set myImg = LoadPictureGDIplus(myField.GetChunk(0, myField.FieldSize), False)
        Set myEffects = New GDIpEffects
        myEffects.TransparentColorUsed = True
        myEffects.TransparentColor = GetPixelGDIplus(myImg, 0, 0)

        'Expected to work
        'With IIf(mbPrinting, Printer, myPicBox)
        'myImg.Render .hDC, _
                             .ScaleX(mnLinAssPosX + mnMargemEsq, vbMillimeters, vbPixels) + .ScaleX(mnRTAssImgOffSetX, vbTwips, vbPixels) - myImg.Width / 2, _                                                                 
                             .ScaleY(mnLinAssPosY + mnMargemSup, vbMillimeters, vbPixels) + .ScaleY(mnRTAssImgOffSetY, vbTwips, vbPixels) - myImg.Height / 2, _
                             , , , , , , , myEffects.AttributesHandle, , myEffects.EffectsHandle(lvicNoEffects), lvicHighQualityBicubic
        'End with

        'Atcual work
        myImg.Render IIf(mbPrinting, Printer.hDC, myPicBox.hDC), _
                             myPicBox.ScaleX(mnLinAssPosX + mnMargemEsq, vbMillimeters, vbPixels) + myPicBox.ScaleX(mnRTAssImgOffSetX, vbTwips, vbPixels) + IIf(mbPrinting, 27, 0) - myImg.Width / 2, _                                                                 
                             myPicBox.ScaleY(mnLinAssPosY + mnMargemSup, vbMillimeters, vbPixels) + myPicBox.ScaleY(mnRTAssImgOffSetY, vbTwips, vbPixels) + IIf(mbPrinting, 43, 0) - myImg.Height / 2, _
                             , , , , , , , myEffects.AttributesHandle, , myEffects.EffectsHandle(lvicNoEffects), lvicHighQualityBicubic
Original image: Name:  ass.png
Views: 1343
Size:  626 Bytes
Results
Picture box:Name:  picbox.png
Views: 1344
Size:  2.4 KB
Printer: Name:  print.png
Views: 1324
Size:  2.8 KB


Have you ever dealt with such issue?

Thanks in advance.

Best regards.