FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Timage problem
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Timage problem
Posted: Thu Jan 10, 2008 08:11 PM

Hi,

The following code :

  oClipboard := TClipboard():New( CF_BITMAP )
  hBitmap    := oClipboard:GetBitmap()
  oClipboard:End()
  if hBitmap != 0
     cimagemp := unicof(".jpg")
     oimg:cResname:=nil
     oimg:LoadFromClipboard()  
     oimg:refresh()

everything ok here

          if !oimg:SaveImage(cimagemp,2) //0 = bmp 2 = jpg

it never saves the image to afile.

Any ideas ?

Antonio

Regards

Antonio H Ferreira
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Timage problem
Posted: Fri Jan 11, 2008 09:11 AM

Any ideas ?

Antonio

Regards

Antonio H Ferreira
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: Timage problem
Posted: Sat Jan 12, 2008 10:30 PM
This is a working sample:

#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg, oImg

    DEFINE DIALOG oDlg;
           SIZE 700, 500

    @ 1, 1 IMAGE oImg;
           FILE "IMAGE.JPG";
           SIZE 200, 200;
           ADJUST

    @ 0,  1 BUTTON "Save";
            ACTION MSGINFO( oImg:SaveImage( "SAVED.JPG", 2 ) )

    @ 0, 7 BUTTON "Paste";
           ACTION ( oImg:LoadFromClipboard(),;
                    oImg:Refresh() )

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG
Posts: 838
Joined: Fri Feb 10, 2006 12:14 PM
Timage problem
Posted: Mon Jan 14, 2008 09:16 AM

Enrico,

Code is basiclly the same.

Doesn't work for me.

If I save a image loaded from clipboard it save the file with o bytes. Otherwise it works ok.

Im using FWH March 2006. What yours ?

Antonio

Regards

Antonio H Ferreira
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Timage problem
Posted: Mon Jan 14, 2008 09:45 AM

I'm using the latest FWH (Jan 2008).

EMG

Continue the discussion