Page 1 of 1

Re: generar bmp con texto

Posted: Sat Aug 28, 2021 1:35 am
by nageswaragunupudi

Code: Select all | Expand

function TextOnImage()

   local hBmp
   local cSrcImage   := "c:\fwh\bitmaps\olga1.jpg"
   local cDstImage   := "olganame.jpg"
   local cText       := "Olga" + CRLF + "Kurylenko"
   local oFont, oLarg, oSmal

   DEFINE FONT oLarg NAME "VERDANA" SIZE 0,-50
   DEFINE FONT oFont NAME "TAHOMA"  SIZE 0,-30
   DEFINE FONT oSmal NAME "TAHOMA"  SIZE 0,-16

   hBmp  :=  FW_MakeYourBitmap( 352, 450, <|hDC, w, h |
               FW_DrawImage( hDC, cSrcImage, { 0, 0, h, w } )
               FW_SayText( hDC, cText, { 0, 0, h-30, w }, "B", { oLarg, oFont } )
               FW_SayText( hDC, "FWH Image Functions", { 30, 0, h, w }, "T", oSmal )
               return nil
               > )

   FW_SaveImage( hBmp, cDstImage, 100 )

   XImage( cDstImage )

   // cleanup
   DeleteObject( hBmp )
   RELEASE FONT oLarg,oFont, oSmal

return nil
 


Image

Re: generar bmp con texto

Posted: Sun Aug 29, 2021 9:13 am
by Marc Venken
Mr. Rao,

I looked into the source of : * imgtxtio.prg where these functions are. (shadow, ...) maybe some more fancy stuff

What approch would you suggest for generating (in a loop) several new image combined with (second jpg or textual) for having this kind of result :

https://www.maveco-webshop.be/outlet/schoenen/

The discount text is a second image that is merged by the shop software, but it can be only 1 merged item.

With FW i could generate the image from source with all items on it and than upload. ( discount, OnStock, Sold Out, Promotion )