J'ai un problème très gênant avec l'enregistrement dynamique d'une image à partir d'un texte de base de données. Ce code fonctionne bien sur ma boîte de dev, mais pas sur le serveur de production.Création d'image sur le serveur de production
Voici un échantillon de ce que je suis en train de faire:
private void SaveImage()
{
Bitmap objBmpImage = new Bitmap(300, 300);
int intWidth = 0;
int intHeight = 0;
// Create the Font object for the image text drawing.
Font objFont = new Font("Arial", 12, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Pixel);
// Create a graphics object to measure the text's width and height.
Graphics objGraphics = Graphics.FromImage(objBmpImage);
// This is where the bitmap size is determined.
intWidth = 100;
intHeight = 100;
// Create the bmpImage again with the correct size for the text and font.
//objBmpImage = new Bitmap(objBmpImage, new Size(intWidth, intHeight));
// Add the colors to the new bitmap.
objGraphics = Graphics.FromImage(objBmpImage);
//bounding box
RectangleF rectf = new RectangleF(0, 0, 295, 295);
// Set Background color
objGraphics.Clear(Color.White);
objGraphics.SmoothingMode = SmoothingMode.AntiAlias;
objGraphics.TextRenderingHint = TextRenderingHint.AntiAlias;
objGraphics.DrawString("Test", objFont, Brushes.Black, rectf);
objGraphics.Flush();
objBmpImage.Save(@"***SERVER PATH HERE****");
Response.Write("Image saved completed");
}
chemin du serveur, il dispose d'un service réseau écrire Permissio
Merci Alexei! Je vais vérifier cela. Le site fonctionne sur un plan d'hébergement partagé par Softsys. J'ai donc peu de contrôle sur les comptes qui obtiennent des autorisations. Peut-être que l'usurpation d'identité est la voie à suivre pour écrire l'image. Merci pour l'aide! – adminJaxon