RE: How to set both height and width of an image?

"Christian Cryder" <[email protected]>
Newsgroups gmane.comp.java.enhydra.barracuda.general
Message-ID <[email protected]>
Or you could just do something like this...

<TD>
  <IMG src="foo.gif" alt="" width="120" height="20"
   class="Dir::Get_Data.HeadFootModel.Image1" border="0">
</TD>

where your model passes back a BComponent...

public Object getItem(String key) {
    ...    
    } else if (key.equals("Image1")) {
        BComponent bcomp = new BComponent();
        bcomp.setAttr("width", "150");
        bcomp.setAttr("height", "150");
        return bcomp;
    } ...
}

Make sense?
Christian
----------------------------------------------
Christian Cryder
Internet Architect, ATMReports.com
Project Chair, BarracudaMVC - http://barracudamvc.org
----------------------------------------------
"Coffee? I could quit anytime, just not today" 


> -----Original Message-----
> From: [email protected] 
> [mailto:[email protected]]On Behalf Of Diez B. Roggisch
> Sent: Sunday, September 21, 2003 2:07 PM
> To: [email protected]
> Subject: Re: [Barracuda] How to set both height and width of an image?
> 
> 
> > <TD><IMG src="foo.gif" alt="" width="120" height="20"
> > class="Dir::get_data.HeadFoot.Image1.width" border="0"></TD>
> >
> > In the above code, is there a way that I can set both width and 
> the height
> > of the image dynamically?
> >
> > Any pointers would be highly appreciated.
> 
> Barracuda evaluates an arbitrary number of space-separated 
> directives in the 
> class-attribute. So you can do it like this:
> 
> <IMG src="foo.gif" alt="" width="120" height="20" 
> class="Dir::set_attr.HeadFoot.ImageWidth.width 
> Dir::set_attr.HeadFoot.ImageHeight.height" border="0">
> 
> I'm not totally sure about the format of the directive, but its close 
> enough :)
> 
> Diez
> 
> _______________________________________________
> Barracuda mailing list
> [email protected]
> http://barracudamvc.org/lists/listinfo/barracuda
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.