30. august 2006 - 09:29
Der er
3 kommentarer og 1 løsning
ASPImage Crop funktion virker ikke
Width = Image.MaxX Height = Image.MaxY NHeight = 100 NWidth = 100 if Image.MaxX>Image.MaxY then if (Image.MaxY/Image.MaxX)*100>80 then Image.MaxY = NHeight Image.MaxX = NWidth response.write "!" else Image.MaxY = NHeight Image.MaxX = Image.MaxY * Image.MaxX / Image.MaxY chopoff=(Image.MaxX-NWidth)/2 Image.Cropimage chopoff,0 , Image.MaxX-chopoff, 100 response.write "!s" end if else if (Image.MaxX/Image.MaxY)*100>80 then Image.MaxY = NHeight Image.MaxX = NWidth else Image.MaxX = NWidth Image.MaxY = Image.MaxY * Image.MaxX / Image.MaxX chopoff=(Height-100)/2 Image.Cropimage 0, chopoff, NWidth, Image.MaxY-chopoff Image.SaveImage end if end if Når køre dette sker der intet billedet har samme dimensioner som da jeg uploadede det, det bilver ikke croppet.
Annonceindlæg fra Kommando
30. august 2006 - 11:12
#1
Width = Image.MaxX Height = Image.MaxY NHeight = 100 NWidth = 100 if Width>Height then if (Height/Width)*100>80 then Height = NHeight Width = NWidth else Height = NHeight Width = Height * Width / Height chopoff=(Width-NWidth)/2 Image.Cropimage chopoff,0 , Width-chopoff, 100 end if else if (Width/Height)*100>80 then Height = NHeight Width = NWidth else Width = NWidth Height = Height * Width / Width chopoff=(Height-100)/2 Image.Cropimage 0, chopoff, NWidth, Height-chopoff end if end if Image.SaveImage Hvorfor sker der intet jeg har prøvet 100 ting men uanset hvad jeg gør bliver original billedet gemt uden nogen crop
30. august 2006 - 12:07
#2
luk
30. august 2006 - 12:09
#3
øhh - umiddelbart ser det ud som om at du ikke gemmer billedet, med Image.FileName f.eks - filnavn = "billed.jpg" Set Image = Server.CreateObject("AspImage.Image") Image.LoadImage server.mappath("\upload\" & filnavn & "") Image.JPEGQuality = 80 Width = Image.MaxX Height = Image.MaxY NHeight = 100 NWidth = 100 if Width>Height then if (Height/Width)*100>80 then Height = NHeight Width = NWidth else Height = NHeight Width = Height * Width / Height chopoff=(Width-NWidth)/2 Image.Cropimage chopoff,0 , Width-chopoff, 100 end if else if (Width/Height)*100>80 then Height = NHeight Width = NWidth else Width = NWidth Height = Height * Width / Width chopoff=(Height-100)/2 Image.Cropimage 0, chopoff, NWidth, Height-chopoff end if end if Image.ImageFormat = 1 Image.FileName = Server.MapPath("\upload\billed.") Image.SaveImage Set Image = Nothing
31. august 2006 - 14:42
#4
det fandt jeg ud af igår det var derfor jeg lukkede men jeg glemte desværrer at skrive jeg havde fundet svaret
Kurser inden for grundlæggende programmering