Author | Topic: Scaling of Pictures | |
---|---|---|
James Loughner | Scaling of Pictures on Sat, 16 May 2020 13:02:00 -0400 I'm trying to scale large jpgs to a smaller screen. I can do this (I have tried several things) and it works but the pictures come out pixelated. Anyone know the secret sauce to fully view a large JPG on a much smaller static without pixelatiion ??? I currently am displaying the pic vie a viewport and using scrollbars to move the picture. This works fine but really need to see the whole pic at one time Jim | |
Carlos A Beling | Re: Scaling of Pictures on Sat, 16 May 2020 16:12:44 -0300 Hello Jim. Good afternoon. What format of picture areyou using? Did you already try the parameter <nCommpress> in the methods XbpBitmap():draw() and/or XbpIcon():draw() and/or the function GraBitBlt()? Fraternally Beling On 16/05/2020 14:02, James Loughner wrote: > > I'm trying to scale large jpgs to a smaller screen. I can do this (I > have tried several things) and it works but the pictures come out > pixelated. > > Anyone know the secret sauce to fully view a large JPG on a much smaller > static without pixelatiion ??? > > I currently am displaying the pic vie a viewport and using scrollbars to > move the picture. This works fine but really need to see the whole pic > at one time > > Jim | |
Jim Lee | Re: Scaling of Pictures on Sun, 17 May 2020 00:29:10 +0200 hi, > I'm trying to scale large jpgs to a smaller screen. I can do this (I have > tried several things) and it works but the pictures come out pixelated. > > Anyone know the secret sauce to fully view a large JPG on a much smaller > static without pixelatiion ??? FUNCTION BMP2BMP( oBMP, aXbpSize ) LOCAL oHuge LOCAL oTiny LOCAL oPS LOCAL oRet LOCAL nBits LOCAL nPlanes IF aXbpSize[ 2 ] > 0 oHuge := oBMP nBits := oBMP:bits nPlanes := oBMP:planes oPS := XBPPRESSPACE() :new() :Create() //Create a small bitmap to fit in our XbpStatic oTiny := XBPBITMAP() :New() :Create() oTiny:Make( aXbpSize[ 1 ], aXbpSize[ 2 ], nPlanes, nBits ) oTiny:presSpace( oPS ) Copie and resize the huge bitmap to the small bitmap oHuge:Draw(oPS,{0,0,aXbpSize[1],aXbpSize[2]},,GRA_BLT_ROP_SRCCOPY) try 4 oHuge:Draw( oPS, { 0, 0, aXbpSize[ 1 ], aXbpSize[ 2 ] },,, 4 ) oRet := oTiny ELSE oRet := oBMP ENDIF RETURN oRet other Way is to use 3-PP like FreeImage which "load" much quicker and can do a lot more. Pablo have a Wrapper using Ot4xb | |
Jorge L. Borlando | Re: Scaling of Pictures on Sat, 30 May 2020 14:58:05 -0300 Hi, I use XbpHtmlViewer() to show with the optimal resolution <html> <head></head> <body><img src="file:///D:/IMAGES/IMG0001.JPG" width="xxxx" height="yyyy" </body> </html> "James Loughner" escribió en el mensaje de noticias:1bde5dac$7f886d4a$18e73@news.alaska-software.com... I'm trying to scale large jpgs to a smaller screen. I can do this (I have tried several things) and it works but the pictures come out pixelated. Anyone know the secret sauce to fully view a large JPG on a much smaller static without pixelatiion ??? I currently am displaying the pic vie a viewport and using scrollbars to move the picture. This works fine but really need to see the whole pic at one time Jim |