I am develloping an app to grab jpeg files and send them over an ip connection, but Im having a problem at this time and wish to know if somebody could help me : I am using a dll to convert from a RGB buffer to jpeg format and one of the parameters of the dll function is a integer value representing the jpeg quality (from 1 to 100). If I use this code it works fine : push NULL push 24 push 0 push 75 ; this is the value of jpeg quality push 240 push 320 mov eax,offset imgbuf push eax push hWnd1 call RGBToJPG ;convert RGB to JPG I want to change in my program the value of the jpeg quality and put it in place of the value of 75 above, but I am not figuring how to do it...It is crashing all the way, if I dont do it as above... I wish to define a place in the program where I could define a variable for it : jpgquality db 75 and then use it in the RGB to JPEG routine... Any help will be apreciated, thanks to everyone Sergio A.S. de Aguiar
Posted on 2001-04-13 20:40:00 by ssaguiar
Hi there! this should work: (in .DATA section) jpgquality db 75 (in .CODE section) push NULL push 24 push 0 push jpgquality push 240 push 320 mov eax,offset imgbuf push eax push hWnd1 call RGBToJPG ;convert RGB to JPG Good Luck! Bye Latigo
Posted on 2001-04-13 21:14:00 by latigo
Thanks for your answer, but it didn't work. When I try to compile, I get : RemMon12.asm(2276) : error A2070: invalid instruction operands thanks
Posted on 2001-04-14 13:08:00 by ssaguiar
I found what was wrong and find that I was an idiot: I first defined, in my .data section : jpgq dw 25 . . . ;then, in the code where I'll call the ;dll routine, I put : . . xor eax,eax mov ax,jpgq push eax . . All that because the jpeg quality was defined as a UINT32 in the C definitions, and was needed to be called as a double-word (eax)... extern UINT32 _ISEXP_ _ISWriteJPG(HISDEST hDest, BYTE *pImg, UINT32 uWidth, UINT32 uHeight, UINT32 uQuality, UINT32 uProgressive, UINT32 uBytesPerPixel, ISDPIStruct *pDPIStruct); Thanks to everybody : Sergio A.S. de Aguiar
Posted on 2001-04-14 19:03:00 by ssaguiar