Forums de discussion

Image obj

Sarah Di Piero, modifié il y a 15 années.

Image obj

Junior Member Publications: 47 Date d'inscription: 09/08/08 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, modifié il y a 10 années.

RE: Image obj

New Member Envoyer: 1 Date d'inscription: 05/11/13 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.
thumbnail
Rajeeva Lochana .B.R, modifié il y a 10 années.

RE: Image obj

Junior Member Publications: 67 Date d'inscription: 04/01/10 Publications récentes
Hi Sarah,

Use the below code to fetch portraitUrl .


ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);

User user = themeDisplay.getUser();

String pathImage = user.getPortraitURL(themeDisplay);

String portraitUrl =  com.liferay.portal.model.UserConstants.getPortraitURL(pathImage, user.isMale(), user.getPortraitId());