Problem with conversion Image on W7

Post Reply
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Problem with conversion Image on W7

Post by Silvio.Falconi »

I have problem to converte a Png file on Jpg, and then this jpg to Bmp on Windows Seven
I save the images in a ". \ Temp" folder.
After performing the conversion I use the images in a combobox and in Windows Seven IO I see black lines on the images but in reality there are no images saved in a folder ". \ Temp"

Image

you can see on first picture some black line I not Know why ...


to create jpg from Png I made
hBmp := FW_ReadImage( nil, cFile )[ 1 ]
hNew := FW_TransformBitmap( hBmp, NIL, 40)
ext:= aExt[ntipo]
cNewfile:= cFolderTemp+cNewName+ext
FW_SaveImage( hBmp,cNewfile ,90)

then to converte jpg to BMP I made

cFileBmp:= savetobmp(cfileJpg)

Function Savetobmp(cfile)
Local hBmp := FW_ReadImage( nil, cfile )[ 1 ]
FW_SaveImage( hBmp, cfile+".Bmp",90 )
Return cfile


on windows 10 it runs perfectly, on windows Seven How I can resolve ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem with conversion Image on W7

Post by nageswaragunupudi »

What if you try this way?

Code: Select all

FW_SaveImage( "file.png", "file.jpg", nQuality )
FW_SaveImage( "file.png", "file.bmp )
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with conversion Image on W7

Post by Silvio.Falconi »

nageswaragunupudi wrote:What if you try this way?

Code: Select all

FW_SaveImage( "file.png", "file.jpg", nQuality )
FW_SaveImage( "file.png", "file.bmp )
Nages, I tried it but bmp images are created perfectly then when you use the combox you see black lines
in the snapshot below you can see that the selected image has black lines, the image to be selected is shown very well

Image

I made a small test

Code: Select all

#include "fivewin.ch"

Function test()
   local oDlg
   local oCbx
   local nIcoElemento := 1
   local aGet[1]
   local aElementiItems:= {}
   Local aFiles:={"ombrellone_verde.png",;
                  "Palma_verde.png",;
                  "cabina_verde.png",;
                  "tenda_verde.png"}

   local aBmpCombo:=Convert_2_Bmp(aFiles)

           for n= 1 to  Len(aBmpCombo)
             AaDd(aElementiItems,"")
           next


  define dialog oDlg  size 400,400 title "Test combo Images"
   @ 2,5 COMBOBOX aGet[1] VAR nIcoElemento Items aElementiItems ;
            BITMAPS aBmpCombo SIZE 50,120 PIXEL  of oDlg
  activate dialog oDlg centered

    return nil
//-------------------------------------------------------------------//
Function Convert_2_Bmp(aFiles)
   local atmp:= {}
   local n
   local nQuality:= 90

             For n= 1 to 4
               cNewFile:="temp_"+(ltrim(str(n)))+".bmp"
               FW_SaveImage( aFiles[n],  cNewFile,nQuality )
               aadd( atmp, cNewFile )
             next n

        return atmp
//-------------------------------------------------------------------//
 
I sent you my images via MAIL
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem with conversion Image on W7

Post by nageswaragunupudi »

So, you have problem in converting to bmp?

One question:
Why do you want to convert png into bmp? You can use png directly with combobox now.
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with conversion Image on W7

Post by Silvio.Falconi »

>You can use png directly with combobox now

FROM WHEN ?

i MADE

Local aFiles:={"ombrellone_verde.png",;
"Palma_verde.png",;
"cabina_verde.png",;
"tenda_verde.png"}

@ 2,5 COMBOBOX aGet[1] VAR nIcoElemento Items aElementiItems ;
BITMAPS aFiles SIZE 50,120 PIXEL of oDlg

AND IT IS THE SAME
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with conversion Image on W7

Post by Silvio.Falconi »

SORRY
I have problem to pngs
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Problem with conversion Image on W7

Post by nageswaragunupudi »

Code: Select all

function TestCbx()

   local oDlg, oCbx, oBold
   local cVar  := 3
   local aItems   := { "One", "Two", "Three", "Four" }
   local aBmp

   aBmp := { "c:\tests\silvio\ombrellone_verde.png", "c:\tests\silvio\tropical_verde.png", ;
             "c:\fwh\bitmaps\pngs\image3.png",       "c:\fwh\bitmaps\pngs\image4.png" }

   DEFINE FONT oBold NAME "TAHOMA" SIZE 0,-20 BOLD
   DEFINE DIALOG oDlg SIZE 400,400 PIXEL TRUEPIXEL

   @ 30,30 COMBOBOX oCbx VAR cVar ITEMS aItems ;
      BITMAPS aBmp ;
      SIZE 300,200 PIXEL OF oDlg UPDATE FONT oBold

   @ 200,100 BUTTON "OK" SIZE 100,40 PIXEL OF oDlg

   ACTIVATE DIALOG oDlg CENTERED
   RELEASE FONT oBold

   ? cvar

return nil
 
Image

I do not see any lines.
I tested on windows 10
Regards

G. N. Rao.
Hyderabad, India
User avatar
Silvio.Falconi
Posts: 4956
Joined: Thu Oct 18, 2012 7:17 pm

Re: Problem with conversion Image on W7

Post by Silvio.Falconi »

obviously the problem I do not have on windows 10, but in windows Seven as I specified in the first post

so I tried your test on Windows Seven

Please select the tropical selection, when you select this you'll see the line black on bitmap

Image
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Post Reply