Hello everyone.
I need help with a function from Bos Taurus.
If I open a PNG file
hBitmap := BT_BitmapLoadFile (cLocalTempFile) and have it saved as a JPG
BT_BitmapSaveFile (hBitmap, cLocalTempFile, BT_FILEFORMAT_JPG)
it changes my background color to black.
It is possible to set or change it somewhere
Bos Taurus BT_BitmapSaveFile
Moderator: Rathinagiri
Bos Taurus BT_BitmapSaveFile
- Attachments
-
- 40319.jpg (39 KiB) Viewed 5412 times
Re: Bos Taurus BT_BitmapSaveFile
I am attaching the files for the test
- Attachments
-
- pfoto.zip
- (214.23 KiB) Downloaded 129 times
- vagblad
- Posts: 174
- Joined: Tue Jun 18, 2013 12:18 pm
- DBs Used: MySQL,DBF
- Location: Thessaloniki, Greece
Re: Bos Taurus BT_BitmapSaveFile
Hi Georg,
The background turns to black because the png file contains a transparency layer which you cannot transfer to the .jpg format. Try this sample code if you please:
I hope it helps!
The background turns to black because the png file contains a transparency layer which you cannot transfer to the .jpg format. Try this sample code if you please:
Code: Select all
Local hBitmap := NIL
Local hBitmap2 := NIL
hBitmap := BT_BitmapLoadFile("62451.png")
hbitmap2 := BT_BitmapCreateNew (BT_BitmapWidth (hBitmap), BT_BitmapHeight (hBitmap), {255,255,255})
BT_BitmapPasteTransparent (hBitmap2, 0, 0, , , BT_COPY, hBitmap, )
BT_BitmapSaveFile (hBitmap2, "new.jpg", BT_FILEFORMAT_JPG)
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
Email: vagblad@gmail.com, Skype: vagblad
Re: Bos Taurus BT_BitmapSaveFile
Thanks for the help, but the result is the same
- Attachments
-
- Screenshot_1.png (492.08 KiB) Viewed 5318 times
Re: Bos Taurus BT_BitmapSaveFile
Hi Georg,
The suggested code for conversion your PNG file is correct.
Please take a look at the attached JPG result file with white background after conversion.
- Attachments
-
- new.zip
- (30.2 KiB) Downloaded 144 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
Re: Bos Taurus BT_BitmapSaveFile
Vagelis & Grigory
Thanks for help
I went through it again, and the fault was between the chair and the computer.
Everything works correctly there is a white background
Sincerely Georg
Thanks for help
I went through it again, and the fault was between the chair and the computer.
Everything works correctly there is a white background
Sincerely Georg
- vagblad
- Posts: 174
- Joined: Tue Jun 18, 2013 12:18 pm
- DBs Used: MySQL,DBF
- Location: Thessaloniki, Greece
Re: Bos Taurus BT_BitmapSaveFile
Great!i am glad it works. And once again a big thank you to Dr. Soto for the amazing BT library
Vagelis Prodromidis
Email: vagblad@gmail.com, Skype: vagblad
Email: vagblad@gmail.com, Skype: vagblad
- Rathinagiri
- Posts: 5482
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Bos Taurus BT_BitmapSaveFile
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.