Alright, my image viewer is working perfectly with this method for displaying images. The results now are much much better.
I have a question. My program also has some editing capabilities (using hotkeys and Imagemagick), such as controlling contrast, saturation, levels, tones, etc. After every change, I'm using guicontrol in order to refresh the resulting image on screen. However, this means that the refreshed image is displayed the old way, not with the dll. Do you know any way to do this, but using the dll?
My code is something like this:
hBM1 := LoadPicture( image111, "GDI+")
hBM2 := DllCall( "Resample\CreateResampledBitmap", "UInt",DllCall( "GetDC", "UInt", 0 )
, "UInt",hBM1, "UInt",wd, "UInt",hg, "UInt",LANCZOS3 )
Gui, 2: Add, picture,x0 y%ya% w%wg% h%hd% vimage1 -background, HBITMAP:%hBM2%
guicontrol,2:, image1, %image111%
I have tried with guicontrol,2:, image1, HBITMAP:%hBM2% but it doesn't work.
EDIT: Forget it. It's working. I forgot that I had to use the .dll again after the edition of the images.