is it possible, a UNDO only for the last action on imagepainting ?
I can use oImg:Refresh(), but it clears the image and all paintings I have done before, are deleted as well.
All positions are defined with mouseclick top / left and bottom / right and calculated in relation to the original image-size.
I created this tool because doing all this with a commercial tool, many steps are needed and some options are not possible.
A solution would make it perfect.
NOTES : I ordered a extra NEW homepage. There I will place all tools and tips for download.
The drawing-options are called inside the function :
DRAWIMG( oDrawImg, hDC )
( The different values are define as STATIC )
Possible paintings on a image :
with any pensize and color :
Freehand
Line
Box
Fill
with selected font and color :
Date + Time stamp
Date stamp
Time stamp
using a resize-factor on :
Image-Logo
Transparent Logo ( with selected transparent-level )
Signature ( can be created inside the EXTRA-dialog)
Maybe SAVING and RESTORING the last painting ?
- Code: Select all Expand view RUN
// -----------------
STATIC FUNCTION DRAWIMG( oDrawImg, hDC )
LOCAL nWidth := oDrawImg:nWidth()
LOCAL nHeight := oDrawImg:nHeight()
LOCAL hMemBmp, hBmpOld
LOCAL hBitmap := oDrawImg:hBitmap
LOCAL hPalette := oDrawImg:hPalette
hMemDC := CREATECOMPATIBLEDC( hDC )
hMemBmp := CREATECOMPATIBLEBITMAP( hDC, nWidth, nHeight )
hBmpOld := SELECTOBJECT( hMemDC, hMemBmp )
PALBMPDRAW( hMemDC, 0, 0, hBitmap, hPalette, nWidth, nHeight )
// ------ STYLES -----------
IF cDrawStyle = "Freehand"
DRAWPOINTS( hMemDC )
ENDIF
IF cDrawStyle = "Lines"
CLICK_LINES( hMemDC )
ENDIF
IF cDrawStyle = "Box"
CLICK_BOX( hMemDC )
ENDIF
IF cDrawStyle = "Fill"
CLICK_FILL( hMemDC )
ENDIF
IF cDrawStyle = "Date + Time"
CLICK_DT( hMemDC )
ENDIF
IF cDrawStyle = "Date"
CLICK_DATE( hMemDC )
ENDIF
IF cDrawStyle = "Time"
CLICK_TIME( hMemDC )
ENDIF
IF cDrawStyle = "Image-Logo"
DRAW_IMAGE( hMemDC )
ENDIF
IF cDrawStyle = "Transp.Logo"
DRAW_LOGO( hMemDC )
ENDIF
// -----------------
SELECTOBJECT( hMemDC, hBmpOld )
DELETEDC( hMemDC )
oDrawImg:hBitmap = hMemBmp
PALBMPFREE( hBitmap, hPalette )
PALBMPNEW( oDrawImg:hWnd, oDrawImg:hBitmap, oDrawImg:hPalette )
oDrawImg:Refresh()
RETURN NIL
Inside EXTRAS : define dialog-background, signature, date/timestamp-font and a resize-factor of a saved image
Best regards
Uwe