Forum

Accueil » Liferay Portal » English » 3. Development

Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Sarah Di Piero
Image obj
17 janvier 2009 08:13
Réponse

Sarah Di Piero

Rang: Junior Member

Publications: 56

Date d'inscription: 9 août 2008

Publications Récentes

Hi,
I have wrote:

[...]
long portraitId = user.getPortraitId();
try{
Image image = ImageUtil.findByPrimaryKey(portraitId);
}
catch(SystemException sExc){
sExc.printStackTrace();
}
catch(NoSuchImageException nExc){
nExc.printStackTrace();
}
[...]

I need of the URL to the picture, is it possible?
Jimmy Smith
RE: Image obj
4 novembre 2013 19:22
Réponse

Jimmy Smith

Rang: New Member

Publications: 1

Date d'inscription: 4 novembre 2013

Publications Récentes

Following complete demo code in VB class is offered to help users to download image from website link more easily.
Imports RasterEdge.Imaging.Basic.Core
Imports RasterEdge.Imaging.Basic.Codec
Imports RasterEdge.Imaging.Basic

Namespace RE__Test
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub

Private Sub button1_Click(sender As Object, e As EventArgs)
Dim reImage As REImage = REFile.GetImageFromURL("http://www.rasteredge.com/Sample.png", New PNGDecoder())

REFile.SaveImageFile(reImage, "c:/reimage.png", New PNGEncoder())
End Sub
End Class
End Namespace

Apart from image downloading from web URL, this .NET Imaging SDK still supports users performing image viewing, processing and annotating programs in VB.NET.
Rajeeva Lochana .B.R
RE: Image obj
5 novembre 2013 00:22
Réponse

Rajeeva Lochana .B.R

Rang: Junior Member

Publications: 64

Date d'inscription: 4 janvier 2010

Publications Récentes

Hi Sarah,

Use the below code to fetch portraitUrl .


1ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);
2
3User user = themeDisplay.getUser();
4
5String pathImage = user.getPortraitURL(themeDisplay);
6
7String portraitUrl =  com.liferay.portal.model.UserConstants.getPortraitURL(pathImage, user.isMale(), user.getPortraitId());