Photos
Moderator: Rathinagiri
- serge_girard
- Posts: 3309
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Photos
Hi there,
Does somebody know how to put autograph (some text) on a JPG/BMP/PNG file. Preferably in batch, complete folder...
Thx/Serge
Does somebody know how to put autograph (some text) on a JPG/BMP/PNG file. Preferably in batch, complete folder...
Thx/Serge
There's nothing you can do that can't be done...
Re: Photos
Hi Serge,serge_girard wrote: ↑Thu Jun 15, 2023 12:22 pm Hi there,
Does somebody know how to put autograph (some text) on a JPG/BMP/PNG file. Preferably in batch, complete folder...
I think it's possible with the great BosTaurus library.
Please take a look at the simple procedure below:
Code: Select all
/*
*/
DECLARE WINDOW _HMG_SPLASHWINDOW
/*
*/
Procedure textout()
LOCAL hDC, BTstruct
LOCAL hBitmap, hBitmap_aux
LOCAL nTypeText
LOCAL nAlingText
LOCAL nOrientation
LOCAL nW := BT_BitmapWidth(_HMG_SPLASHWINDOW.IMAGE.hBitmap)
LOCAL nH := BT_BitmapHeight(_HMG_SPLASHWINDOW.IMAGE.hBitmap)
// Create bitmap in memory
hBitmap := BT_BitmapCreateNew (nW, nH, WHITE)
// Create hDC to a bitmap
hDC := BT_CreateDC (hBitmap, BT_HDC_BITMAP, @BTstruct)
// Paste image
hBitmap_aux := BT_BitmapLoadFile ("Splash") // load from resource
BT_DrawBitmapTransparent (hDC, 0, 0, nW, nH, BT_SCALE, hBitmap_aux, NIL)
BT_BitmapRelease (hBitmap_aux)
// Draw Text
nTypeText := BT_TEXT_TRANSPARENT + BT_TEXT_BOLD + BT_TEXT_ITALIC
nAlingText := BT_TEXT_LEFT + BT_TEXT_TOP
nOrientation := BT_TEXT_NORMAL_ORIENTATION
BT_DrawText (hDC, 450, 350, "EXTENDED", "Times New Roman", 18, BLACK, WHITE, nTypeText, nAlingText, nOrientation)
BT_BitmapSaveFile( hBitmap, "test.png", BT_FILEFORMAT_PNG )
// Release hDC bitmap
BT_DeleteDC (BTstruct)
_HMG_SPLASHWINDOW.IMAGE.hBitmap := hBitmap
_HMG_SPLASHWINDOW.IMAGE.Refresh()
Return
and the result image with added text is
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
- serge_girard
- Posts: 3309
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
-
- Posts: 281
- Joined: Sat May 18, 2019 2:11 pm
- DBs Used: Visual FoxPro, FoxPro
- Location: United States of America
Re: Photos
Hello All,
I am very interested in this but could not run the code in "Official HMG".
The sample code eventually compiled when I changed "dot separated" syntax such as
_HMG_SPLASHWINDOW.IMAGE.hBitmap
into GetProperty(...) syntax.
However I cannot fix the following _HMG_SPLASHWINDOW error: Any help on what I am missing would be greatly appreciated!
Thank you!
I am very interested in this but could not run the code in "Official HMG".
The sample code eventually compiled when I changed "dot separated" syntax such as
_HMG_SPLASHWINDOW.IMAGE.hBitmap
into GetProperty(...) syntax.
However I cannot fix the following _HMG_SPLASHWINDOW error: Any help on what I am missing would be greatly appreciated!
Thank you!
Re: Photos
Hello Spencer,
Thanks for your interest.
You can find the source code for this example along with the executable in the attachment below.
But the above code is for use with MiniGUI Extended Edition.
Thanks for your interest.
You can find the source code for this example along with the executable in the attachment below.
But the above code is for use with MiniGUI Extended Edition.

- Attachments
-
- SPLASHDEMO.ZIP
- Splash demo example
- (1.24 MiB) Downloaded 111 times
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
-
- Posts: 281
- Joined: Sat May 18, 2019 2:11 pm
- DBs Used: Visual FoxPro, FoxPro
- Location: United States of America
Re: Photos
Thank you very much Gregory!!!
- serge_girard
- Posts: 3309
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Photos
Hi,
I'm adapting to my needs: row, col, text, color, font, size,.... will all be variable and to be edited on form.
Next step is to 'stamp' all (or some) photo with this text.
Serge
I'm adapting to my needs: row, col, text, color, font, size,.... will all be variable and to be edited on form.
Next step is to 'stamp' all (or some) photo with this text.
Serge
There's nothing you can do that can't be done...
- serge_girard
- Posts: 3309
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: Photos
Grigory,
Any idea how to 'undo' or reset some mistaken text (when not yet save of course) ?
Serge
Any idea how to 'undo' or reset some mistaken text (when not yet save of course) ?
Serge
There's nothing you can do that can't be done...
Re: Photos
Serge,
Please take a look at the updated sample with Undo effect in the attachment.
Hope that give you some idea
Please take a look at the updated sample with Undo effect in the attachment.
Hope that give you some idea

- Attachments
-
- SPLASHDEMO_2.ZIP
- Show some text on the image and then reset this text
- (1.24 MiB) Downloaded 128 times
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
- AUGE_OHR
- Posts: 2093
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: Photos
hi,
can not open ZIP Files as Windows Defender give a Error Message about "Trojan_WACATAC.B!ML"
can not open ZIP Files as Windows Defender give a Error Message about "Trojan_WACATAC.B!ML"
have fun
Jimmy
Jimmy