IMAGE on BOX

IMAGE on BOX

Postby Silvio.Falconi » Fri Apr 21, 2023 12:31 pm

How I can to create an image on a box ?
I try with

oPrn:Box(X, Y, Z, K,;
{ nColorBordo, 0.1 }, nBackcolor, ;
{"", oFnt, nColorFont, "" }, ;
"CM" )

@ x,y PRINT TO oPrn IMAGE cDesc SIZE nAltezza,nAltezza CM

this is the result

Image

I tried also with

oPrn:cmBox( x, y, x + nAltezza, y + nLarghezza )
@ x,y PRINT TO oPrn IMAGE cDesc SIZE nLarghezza,nAltezza CM


Any solution pls ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7075
Joined: Thu Oct 18, 2012 7:17 pm

Re: IMAGE on BOX

Postby karinha » Fri Apr 21, 2023 2:36 pm

Silvio, mira se ayuda:

Code: Select all  Expand view  RUN

#include "fivewin.ch"

function Main()

   local nMargin, nGutter, nWidth, nColWidth
   local nRow, nCol
   local oPrn, oPen, oPen2, oFont, oFontV, oFontS, oFont14V, oBrush
   local cSyntax := "Syntax :" + CRLF + ;
         "RoundBox( nTop, nLeft, nBottom, nRight, nRndW, nRndH, oPen, onBack, aText, cUnits )"
   local cText := "aText :" + CRLF + "{ cText, oFont, nClrText, [cAlign] }"

   // DEFINE BRUSH oBrush FILE "c:\fwh1905\bitmaps\backgrnd\space1.bmp"
   DEFINE BRUSH oBrush FILE "c:\fwh1905\bitmaps\alphabmp\printer.bmp" // RESIZE

   PRINT oPrn PREVIEW

   DEFINE PEN oPen WIDTH 3 COLOR CLR_HRED OF oPrn
   DEFINE PEN oPen2 WIDTH 1 COLOR CLR_BLACK OF oPrn
   DEFINE FONT oFontS NAME "ARIAL" SIZE 0,-12 OF oPrn
   DEFINE FONT oFont  NAME "ARIAL" SIZE 0,-20 OF oPrn
   DEFINE FONT oFontV NAME "ARIAL" SIZE 0,-20 BOLD NESCAPEMENT 900 OF oPrn
   DEFINE FONT oFont14V NAME "ARIAL" SIZE 0,-14 NESCAPEMENT 900 OF oPrn

   nMargin     := Int( 0.1 * oPrn:nHorzRes() )
   nWidth      := 8 * nMargin
   nColWidth   := Int( ( nWidth - nMargin ) / 2 )

   PAGE

   oPrn:RoundBox( 1.0, 1.0, 2.0, 7.5, 0.4, 0.4, oPen, CLR_YELLOW, ;
      { "HORIZONTAL" + CRLF + FWVERSION, { oFont, oFontS }, CLR_HRED }, "INCHES" )

   oPrn:RoundBox( 2.2, 1.0, 4.2, 2.0, 0.2, 0.2, oPen, CLR_GRAY,  ;
      { "VERTICAL" + CRLF + "TEXT", oFontV, CLR_YELLOW }, "INCHES" )

   /*
   oPrn:RoundBox( 2.2, 3.0, 4.2, 7.5, 0.3, 0.3, oPen, oBrush, ;
            { cSyntax, oFont, CLR_BLACK }, "INCHES" )
   */


   oPrn:RoundBox( 2.2, 3.0, 4.2, 5.5, 0.3, 0.3, oPen, oBrush, ;
            { cSyntax, oFont, CLR_HRED }, "INCHES" )

   oPrn:RoundBox( 4.4, 3.0, 5.9, 7.5, 0.3, 0.3, oPen, CLR_WHITE, ;
            { cText, oFont, CLR_BLACK }, "INCHES" )

   oPrn:RoundBox( 5.9, 1.5, 7.1, 2.1, 0.1, 0.1, oPen2, CLR_HGRAY, ;
      { "Faturas", oFont14V, CLR_BLACK }, "INCHES" )

   oPrn:RoundBox( 7.1, 1.5, 8.3, 2.1, 0.1, 0.1, oPen2, CLR_HGRAY, ;
      { "Cálculo" + CRLF + "Imposto", oFont14V, CLR_BLACK }, "INCHES" )

   oPrn:RoundBox( 8.3, 1.5, 10.2, 2.1, 0.1, 0.1, oPen2, CLR_HGRAY, ;
      { "Transportador", oFont14V, CLR_BLACK }, "INCHES" )

   nRow := 4900
   nCol := nMargin

   @ nRow + 20, nCol + 1500 PRINT TO oPrn IMAGE "..\bitmaps\olga1.jpg" SIZE nColWidth, 2000 LASTROW nRow

   ENDPAGE
   ENDPRINT

return nil
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7835
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: IMAGE on BOX

Postby cmsoft » Fri Apr 21, 2023 3:35 pm

Silvio:
Si pruebas dejando un milimetro entre uno y otro?
oPrn:Box(X, Y, Z, K,;
{ nColorBordo, 0.1 }, nBackcolor, ;
{"", oFnt, nColorFont, "" }, ;
"CM" )

@ x+0.01,y+0.01 PRINT TO oPrn IMAGE cDesc SIZE nAltezza-0.02,nAltezza-0.02 CM
User avatar
cmsoft
 
Posts: 1292
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: driessen and 39 guests