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
Timage problem
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: Timage problem
This is a working sample:
EMG
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
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact: