Timage problem

Post Reply
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Timage problem

Post by AHF »

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: 837
Joined: Fri Feb 10, 2006 12:14 pm

Post by AHF »

Any ideas ?

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

Re: Timage problem

Post by Enrico Maria Giordano »

This is a working sample:

Code: Select all

#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
AHF
Posts: 837
Joined: Fri Feb 10, 2006 12:14 pm

Post by AHF »

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
Post Reply