Questions tagged [system.drawing.imaging]
80 questions
0
votes
1 answer
VB.Net How to rotate a rectangle by mouse click and drag
I'm using WinForms with a PictureBox and a custom rectangle drawn on it (face detection). Now I have code that draws the rectangle on the specified coordinates and allows resizing and moving of the rectangle. However, I need to know how to rotate…

Eminem
- 7,206
- 15
- 53
- 95
0
votes
3 answers
How to draw text onto a jpg and resave it using system.drawing in c#
Anyone have good example of how to write text onto a jpg image and resave it using System.Drawing in .NET?

Brian David Berman
- 7,514
- 26
- 77
- 144
0
votes
1 answer
How to save an image instead of making a copy?
I've been tasked with reducing the quality of pictures on a network drive's file/folder system.
Code:
Dim bmp1 As New Bitmap("U:\Image1.jpg")
Dim jpgEncoder As ImageCodecInfo = GetEncoder(ImageFormat.Jpeg)
Dim myEncoder As…

Rueben.Ramirez
- 53
- 6
0
votes
1 answer
Using a System.Drawing.Image as the centered part of a larger image?
I have a System.Drawing.Image that I would like to use as the centered portion for a new, larger image. I’m given the dimensions of the (always) larger image and the idea is to make that image all white and overlay its center with the first image. …

larryq
- 15,713
- 38
- 121
- 190
0
votes
4 answers
passing the right BytesArray into the MemoryStream for Image
there a way to determine that I am passing the right byte array to the MemoryStream if I want to create an Image out of byte array.
MemoryStream mStream = new MemoryStream();
mStream.Write(byteArray, 0, byteArray.Lenth);
Image imgObj =…

rob waminal
- 18,117
- 17
- 50
- 64
0
votes
2 answers
how can a 512x512 bmp image have 1MB of size
my code to save bmp format:
ImgResult.Save(dlgSavePicture.FileName, System.Drawing.Imaging.ImageFormat.Bmp)
I have tried the code and the output is a 512x512 bmp image with 1 megabyte size
if i use ms paint to create a 515x512 bmp image, the size…

belek mata15
- 9
- 1
- 3
0
votes
1 answer
My image is not compressing
Loading code from filesystem:
System.Drawing.Image image = System.Drawing.Image.FromFile(););
Loading code from browser request:
var memoryStream = new MemoryStream();
using (memoryStream)
{
…

Jimmyt1988
- 20,466
- 41
- 133
- 233
0
votes
1 answer
File Size of an Image Increases close to 10 times after Rotating it to a particular angle
I am trying to rotate a image after scanning to improve the readability of scanned images if the skew angle is too high. After finding out the Deskew angle i am trying to rotate the image with the following Code.
After rotating the image and saving…

amithkrp07
- 81
- 1
- 6
0
votes
1 answer
ExternalException when calling Bitmap.Save(…) in Debug build only
I use the following code for output of my calculations which it should be a PNG picture. I do not understand why in Debug run the last line gives me a System.Runtime.InteropServices.ExternalException. On the Release run everything is OK.
I found on…

Mehdi
- 211
- 2
- 11
0
votes
1 answer
Proportional Save Image C#
I want to save image in proportional size without losing its quality. This right if I do that?
var pathImage = "";
var pathFolder = "";
System.Drawing.Image image;
System.Drawing.Image thumb;
image = System.Drawing.Image.FromFile(pathImage); …

Fernando Arce
- 332
- 2
- 14
0
votes
1 answer
Byte size of image grow after split and merge of a Tiff file
I am trying to split and merge a multi-page tiff image. The reason I split is to draw annotations at each image level. The code is working fine, however the merged tiff is pretty large compared to source tiff. For example, I have tested with 17…

Hari Narisetty
- 176
- 1
- 2
- 14
0
votes
3 answers
Assuming ASP.NET and form upload, any way to ensure file is an image?
Is there any way to tell if the file is an image either through MIME type or some other way of inspection? The images are going into a gallery and I'll be resizing them as necessary and want to ensure, to the best I can, that the file I'm about to…

xanadont
- 7,493
- 6
- 36
- 49
0
votes
1 answer
Can't save an Image to MemoryStream
I am trying to save an image to a MemoryStream to get a byte array.
using (MemoryStream ms = new MemoryStream()){
// Convert Image to byte[]
ms.Seek(0, SeekOrigin.Begin);
img.Save(ms, ImageFormat.RawFormat);
byte[]…

rptony
- 1,024
- 1
- 12
- 22
0
votes
1 answer
C# Drawing.Imaging dropping GIF frames if they are identical
I need to load GIF animations and convert them frame by frame to bitmaps. To do that, I am extracting my GIF file frame by frame using Drawing.Imaging library and then casting each frame to bitmap.
Everything works just fine except the times when…

P K
- 5
- 1
- 4
0
votes
3 answers
What is difference between System.Drawing.Image.FromFile() and just Image.FromFile()
I'm new to programming.
I want to know in VB.NET what is difference between these two:
System.Drawing.Image.FromFile()
and
Image.FromFile()
I used both on a picturebox, and both worked.
I just want to know what is difference and which is…

th3kin9
- 3
- 2