tagged [bitmap]
How to create bitmap from byte array?
How to create bitmap from byte array? I searched all question about byte array but i always failed. I have never coded c# i am new in this side. Could you help me how to make image file from byte arra...
Converting BitmapImage to Bitmap and vice versa
Converting BitmapImage to Bitmap and vice versa I have BitmapImage in C#. I need to do operations on image. For example grayscaling, adding text on image, etc. I have found function in stackoverflow f...
What's the difference between Bitmap.Clone() and new Bitmap(Bitmap)?
What's the difference between Bitmap.Clone() and new Bitmap(Bitmap)? As far as I can tell, there are two ways of copying a bitmap. How do these approaches differ? I'm particularly interested in the di...
Overwrite Existing Image
Overwrite Existing Image I have this code i already have an image at my drive . i wanted to replace it with a new image every time my program runs. but a GDI+
Difference between Bitmap.FromFile(path) and new Bitmap(path)
Difference between Bitmap.FromFile(path) and new Bitmap(path) I woud like to know the difference between these two: Is one option better than the other one? Does `Bitmap.FromFile(path)` fills in any a...
Generate image file with low bit depths?
Generate image file with low bit depths? = bits per pixel, so 32bpp means 8/8/8/8 for R/G/B/A. Like .NET has an enum for these "System.Drawing.Imaging.PixelFormat". Now once I have a or object with my...
Android: Bitmaps loaded from gallery are rotated in ImageView
Android: Bitmaps loaded from gallery are rotated in ImageView When I load an image from the media gallery into a Bitmap, everything is working fine, except that pictures that were shot with the camera...
How do I fill a bitmap with a solid color?
How do I fill a bitmap with a solid color? I need to create a 24-bit bitmap (resolution 100x100 pixels) using a unique RGB color and save the generated image to the disk. I currently use the [SetPixel...
A generic error occurred in GDI+
A generic error occurred in GDI+ I loaded an image into a Picture Box using: and I save it by using: It works perfectly fine when creating a new file, but when I try to replace the existing image, I g...
Android: Rotate image in imageview by an angle
Android: Rotate image in imageview by an angle I am using the following code to rotate a image in ImageView by an angle. Is there any simpler and less complex method available. ``` ImageView iv = (Ima...
Automatically trim a bitmap to minimum size?
Automatically trim a bitmap to minimum size? Suppose I have a `System.Drawing.Bitmap` in 32bpp ARGB mode. It's a large bitmap, but it's mostly fully transparent pixels with a relatively small image so...
- Modified
- 27 Jan at 18:18
C# Load JPG file, extract BitmapImage
C# Load JPG file, extract BitmapImage I am trying to extract a BitmapImage from a JPG. This is the code I have: ``` FileStream fIn = new FileStream(sourceFileName, FileMode.Open); // source JPG Bitmap...
- Modified
- 26 Apr at 08:59
Load a bitmap image into Windows Forms using open file dialog
Load a bitmap image into Windows Forms using open file dialog I need to open the bitmap image in the window form using open file dialog (I will load it from drive). The image should fit in the picture...
- Modified
- 6 May at 19:33
How to put image in a picture box from Bitmap
How to put image in a picture box from Bitmap Is it possible to load a picture from memory (`byte[]` or `stream` or `Bitmap`) without saving it to disk? This is the code I use to turn the `byte[]` arr...
converting Java bitmap to byte array
converting Java bitmap to byte array
- Modified
- 5 Aug at 14:59
System.drawing namespace not found under console application
System.drawing namespace not found under console application I selected console application as my C# project. But the imports that seemed to work under Windows Form project don't seem to work here. It...
- Modified
- 7 Apr at 00:17
Save and retrieve image (binary) from SQL Server using Entity Framework 6
Save and retrieve image (binary) from SQL Server using Entity Framework 6 I am trying to save a bitmap image to database I created a column `imgcontent` in the database with datatype `binary` but my p...
- Modified
- 12 Oct at 10:7
fast converting Bitmap to BitmapSource wpf
fast converting Bitmap to BitmapSource wpf I need to draw an image on the `Image` component at 30Hz. I use this code : ``` public MainWindow() { InitializeComponent(); Messenger.Default.Regi...
- Modified
- 9 Jun at 08:55
Convert image to icon in c#
Convert image to icon in c# I have a project that converts an image format file into an icon file. However, after converting the image, the color of the image changes. Here is my code ``` Bitmap theBi...
What happens if i don't call dispose()?
What happens if i don't call dispose()? ``` public void screenShot(string path) { var bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bound...
How to Resize a Bitmap in Android?
How to Resize a Bitmap in Android? I have a bitmap taken of a Base64 String from my remote database, (`encodedImage` is the string representing the image with Base64): ``` profileImage = (ImageView)fi...
How to save PictureBox.Image to file?
How to save PictureBox.Image to file? I use the following to write jpgImage to a PictureBox.Image. and I can use the following to write a byte array to a file ``` using (var bw = new BinaryWriter(Fi...
- Modified
- 27 Jul at 14:2
Android load from URL to Bitmap
Android load from URL to Bitmap I have a question about loading an image from a website. The code I use is: ``` Display display = getWindowManager().getDefaultDisplay(); int width = display.getWidth()...
Rendering to a single Bitmap object from multiple threads
Rendering to a single Bitmap object from multiple threads What im doing is rendering a number of bitmaps to a single bitmap. There could be hundreds of images and the bitmap being rendered to could be...
- Modified
- 16 Mar at 01:41