Click here to Skip to main content
16,018,805 members

Survey Results

Do you browse the internet with Javascript enabled?   [Edit]

Survey period: 19 Jun 2006 to 25 Jun 2006

OptionVotes% 
Yes, always96177.63
Yes, but only for trusted sites18014.54
No977.84



 
GeneralCookies Pin
Mark Focas23-Jun-06 22:45
Mark Focas23-Jun-06 22:45 
GeneralUploading and Resizing an Image Pin
Almerica23-Jun-06 1:27
Almerica23-Jun-06 1:27 
D'Oh! | :doh: Hello All,

I am trying to make a photo gallery fo rmy website. I want to upload images to a directory on the server and resize the image and bring down it's size. I can upload the image but when I try to resize it, I get an error.

Here is the code
Sub resizeImage(ByVal imagePath As String)
Dim originalImage As System.Drawing.Image = System.Drawing.Image.FromFile(imagePath)
'Create bitmap and graphics objects for the new image
Dim thumb As Bitmap = New Bitmap(imagePath)
Dim g As Graphics = Graphics.FromImage(thumb)
'set graphics parameters to optimize thumbnail image
g.CompositingMode = CompositingMode.SourceOver
g.CompositingQuality = CompositingQuality.HighQuality
g.InterpolationMode = InterpolationMode.HighQualityBicubic
g.SmoothingMode = SmoothingMode.HighQuality
g.PixelOffsetMode = PixelOffsetMode.HighQuality
'Transform image to new size and save thumbnail
g.DrawImage(originalImage, 0, 0, 400, 300)
thumb.Save("SmallImage", originalImage.RawFormat)
End Sub



I get this error.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Source Error:


Line 91: 'Transform image to new size and save thumbnail
Line 92: g.DrawImage(originalImage, 0, 0, 400, 300)
Line 93: thumb.Save("SmallImage", originalImage.RawFormat)
Line 94: End Sub
Line 95:

Can anyone help.

Almerica
GeneralRe: Uploading and Resizing an Image Pin
Michael Dunn23-Jun-06 14:35
sitebuilderMichael Dunn23-Jun-06 14:35 
GeneralYes, but... Pin
KaЯl21-Jun-06 21:26
KaЯl21-Jun-06 21:26 
GeneralIt seems Microsoft's shadow is often behind these "innocent" surveys... Pin
Jim Jim20-Jun-06 8:33
Jim Jim20-Jun-06 8:33 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
Jeremy Falcon20-Jun-06 13:21
professionalJeremy Falcon20-Jun-06 13:21 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
nsimeonov21-Jun-06 2:30
nsimeonov21-Jun-06 2:30 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
david s_21-Jun-06 3:48
david s_21-Jun-06 3:48 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
Jeremy Falcon21-Jun-06 6:21
professionalJeremy Falcon21-Jun-06 6:21 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
Almighty Bob21-Jun-06 6:23
Almighty Bob21-Jun-06 6:23 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
John M. Drescher23-Jun-06 21:22
John M. Drescher23-Jun-06 21:22 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... [modified] Pin
Formation Technology21-Jun-06 13:18
Formation Technology21-Jun-06 13:18 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
Paul Lyons22-Jun-06 10:14
Paul Lyons22-Jun-06 10:14 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
J. Dunlap23-Jun-06 2:46
J. Dunlap23-Jun-06 2:46 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
Almighty Bob23-Jun-06 8:11
Almighty Bob23-Jun-06 8:11 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
David Wulff23-Jun-06 11:19
David Wulff23-Jun-06 11:19 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
Almighty Bob23-Jun-06 13:43
Almighty Bob23-Jun-06 13:43 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
J. Dunlap23-Jun-06 19:41
J. Dunlap23-Jun-06 19:41 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
Almighty Bob24-Jun-06 5:27
Almighty Bob24-Jun-06 5:27 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
David Wulff24-Jun-06 2:57
David Wulff24-Jun-06 2:57 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
Almighty Bob24-Jun-06 5:14
Almighty Bob24-Jun-06 5:14 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
Chris Maunder25-Jun-06 6:05
cofounderChris Maunder25-Jun-06 6:05 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
KiwiPiet25-Jun-06 15:57
KiwiPiet25-Jun-06 15:57 
GeneralRe: It seems Microsoft's shadow is often behind these "innocent" surveys... Pin
Jim Jim27-Jun-06 2:45
Jim Jim27-Jun-06 2:45 
GeneralFirefox and NoScripts Pin
Priyank Bolia20-Jun-06 6:07
Priyank Bolia20-Jun-06 6:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.