[TYPO3] mask

Bas van der Togt b.vandertogt at profinit.com
Sat Apr 7 18:52:17 CEST 2007


Hello Miroslav,

Final question!
How can i optimize the quality of the rendered image?
I tried quality = 100 but that's not working.

My code:
tt_content.image.20.1.file >
tt_content.image.20.1.file {
  import.current = 1
  width.field = imagewidth

  m.mask = GIFBUILDER
  m.mask {
        # Here we create a dynamic mask with the exact same
        # dimensions as the actual image, but with rounded corners
    XY = [10.w],[10.h]
    format = jpg
        # Since the "XY" parameter doesn't have stdWrap, we "find"
        # the size by simply loading the original image again.
    10 = IMAGE
    10.file {
      import.current = 1
      width.field = imagewidth
      maxW = {$styles.content.imgtext.maxW}
      maxW.override.data = register:maxImageWidth
      maxWInText = {$styles.content.imgtext.maxWInText}
      maxWInText.override.data = register:maxImageWidthInText
    }
        # Create a white box that fills the entire area
    20 = BOX
    20.dimensions = 0,0,[10.w],[10.h]
    20.color = #FFFFFF
        # Add Top-Left corner mask
    30 = IMAGE
    30.file = {$imagePath}cornermask_tl.gif
    30.align = l,t
        # Add Top-Right corner mask
    40 = IMAGE
    40.file = {$imagePath}cornermask_tr.gif
    40.align = r,t
        # Add Bottom-Left corner mask
    50 = IMAGE
    50.file = {$imagePath}cornermask_bl.gif
    50.align = l,b
        # Add Bottom-Left corner mask
    60 = IMAGE
    60.file = {$imagePath}cornermask_br.gif
    60.align = r,b

    70 = BOX
    70.dimensions = 0,60,190,20
    70.color = green

  }

    # The fastest method (recommended) is using a static image, like this:
    #m.bgImg = {$imagePath}clear.gif
    # But it can also be done dynamically, like this:
  m.bgImg = GIFBUILDER
  m.bgImg {
        # Here we create a dynamic bgMask
        # Dimensions of this image WILL BE THE SAME AS MASK'S
    XY = [5.w],[5.h]
    format = jpg

    5 < tt_content.image.20.1.file.m.mask.10


    10 = BOX
    10.dimensions = 0,0,[5.w],[5.h]
    10.color = {$bgColor}
    20 = TEXT
    20.text.cObject < tt_content.image.20.1.altText
    20.offset = 15,75
    20.niceText = 1
    20.fontSize= 12
    20.fontFile = t3lib/fonts/verdana.ttf
    20.fontColor = #000000
    #80.shadow.offset = 2,2
    20.shadow.blur = 60
    20.shadow.opacity = 40
  }
}

Cheers,
Bas

Miroslav Monkevic schreef:
> Hi,
> 
> Bas van der Togt wrote:
>> Your are right!
>> But now the text is white. How can i make the text black?
>> I tried fontColor = #000000 and black, but that's no working.
>>
>>   
> 
> You never give up (like Tapio) . This is good! :)
> 
>> Do you know why?
> 
> 
> I already answered that: because your text is a mask. This way, for any  
> fontColor  you define for it, resulting text color will be {$bgColor} 
> with different level of transparency.
> There are many ways to achieve the effect you want. For example you can 
> put text into bgImg:
> 
> tt_content.image.20.1.file >
> tt_content.image.20.1.file {
>  import.current = 1
>  width.field = imagewidth
> 
>  m.mask = GIFBUILDER
>  m.mask {
>        # Here we create a dynamic mask with the exact same
>        # dimensions as the actual image, but with rounded corners
>    XY = [10.w],[10.h]
>    format = gif
>        # Since the "XY" parameter doesn't have stdWrap, we "find"
>        # the size by simply loading the original image again.
>    10 = IMAGE
>    10.file {
>      import.current = 1
>      width.field = imagewidth
>      maxW = {$styles.content.imgtext.maxW}
>      maxW.override.data = register:maxImageWidth
>      maxWInText = {$styles.content.imgtext.maxWInText}
>      maxWInText.override.data = register:maxImageWidthInText
>    }
>        # Create a white box that fills the entire area
>    20 = BOX
>    20.dimensions = 0,0,[10.w],[10.h]
>    20.color = #FFFFFF
>        # Add Top-Left corner mask
>    30 = IMAGE
>    30.file = {$imagePath}cornermask_tl.gif
>    30.align = l,t
>        # Add Top-Right corner mask
>    40 = IMAGE
>    40.file = {$imagePath}cornermask_tr.gif
>    40.align = r,t
>        # Add Bottom-Left corner mask
>    50 = IMAGE
>    50.file = {$imagePath}cornermask_bl.gif
>    50.align = l,b
>        # Add Bottom-Left corner mask
>    60 = IMAGE
>    60.file = {$imagePath}cornermask_br.gif
>    60.align = r,b
> 
>    70 = BOX
>    70.dimensions = 0,60,190,20
>    70.color = green
> 
>  }
> 
>    # The fastest method (recommended) is using a static image, like this:
>    #m.bgImg = {$imagePath}clear.gif
>    # But it can also be done dynamically, like this:
>  m.bgImg = GIFBUILDER
>  m.bgImg {
>        # Here we create a dynamic bgMask
>        # Dimensions of this image WILL BE THE SAME AS MASK'S
>    XY = [5.w],[5.h]
>    format = gif
> 
>    5 < tt_content.image.20.1.file.m.mask.10
> 
> 
>    10 = BOX
>    10.dimensions = 0,0,[5.w],[5.h]
>    10.color = {$bgColor}
> 
>    80 = TEXT
>    80.text.cObject < tt_content.image.20.1.altText
>    80.offset = 15,75
>    80.fontColor = red
> 
>  }
> }
> 
> 
>> cheers,
>> Bas
>>
>> Miroslav Monkevic schreef:
>>  
>>> dmc_image_alttext is obsolete, its functionality is in the core long 
>>> time ago.
>>>
>>>
>>> It looks like some other extension was xclassing  tslib_cObj and this 
>>> is where your problems come from.
>>>
>>>
>>>     
> 
> 


More information about the TYPO3-english mailing list