Timage problem

Timage problem

Postby AHF » Thu Jan 10, 2008 8: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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby AHF » Fri Jan 11, 2008 9:11 am

Any ideas ?

Antonio
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Re: Timage problem

Postby Enrico Maria Giordano » Sat Jan 12, 2008 10:30 pm

This is a working sample:

Code: Select all  Expand view  RUN
#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
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby AHF » Mon Jan 14, 2008 9: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
AHF
 
Posts: 838
Joined: Fri Feb 10, 2006 12:14 pm

Postby Enrico Maria Giordano » Mon Jan 14, 2008 9:45 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 68 guests