Click here to Skip to main content
15,891,253 members
Everything / Bitmap

Bitmap

Bitmap

Great Reads

by #realJSOP
Determine the number of unique colors in an image
by Isaac RF
To create visually engaging apps, displaying images is a must. Learn to display Bitmaps Efficiently on your Android apps, without giving away performance. The post Displaying Bitmaps Efficiently on Android apps appeared first on Isaac RF.
by ToughDev
Revisiting Mario Game Written in Pascal
by V.
Convert FITS file to known image formats and use those images for a "zooming" functionality (image transparency)

Latest Articles

by honey the codewitch
Image Resizer automatically resizes images you drop in a monitored folder based on criteria you give it. It can also change image formats.
by ToughDev
Revisiting Mario Game Written in Pascal
by pdoxtader
Very fast image processing without use of unsafe code
by honey the codewitch
Use an ILI9341 display efficiently from an ESP32 without the Arduino framework. Load JPEGs.

All Articles

Sort by Updated

Bitmap 

9 Feb 2024 by honey the codewitch
Image Resizer automatically resizes images you drop in a monitored folder based on criteria you give it. It can also change image formats.
17 Apr 2023 by pdoxtader
Very fast image processing without use of unsafe code
1 Feb 2023 by Graeme_Grant
See if this helps: Image Resizing - outperform GDI+ | CodeProject[^] UPDATE #1 Try: GitHub - mono/SkiaSharp: SkiaSharp is a cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D...
31 Jan 2023 by w14243
E.g. Resize an 8000x8000 big size image to 500x500 small size image, below C# .NET methods were tested: 1. Bitmap smallimg = new Bitmap(bigimg, 500, 500); 2. Bitmap smallimg = bigimg.GetThumbnailImage(500, 500, ...); 3. Bitmap smallimg = new...
20 Nov 2022 by Ronny ronny
you are given two integers N and K, and you need to find two positive integers X and Y such that: X
20 Nov 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...
20 May 2022 by Southmountain
I am testing a demo at this link . I know what this LockBits method does, but not 100% sure why we need to use it. is there any possibility that other processes can modify this bmpData ? I copy the source code here for your convenience: ...
20 May 2022 by Richard MacCutchan
See the Remarks section at Bitmap.LockBits Method (System.Drawing) | Microsoft Docs[^].
4 May 2021 by honey the codewitch
Use an ILI9341 display efficiently from an ESP32 without the Arduino framework. Load JPEGs.
17 Apr 2021 by honey the codewitch
GFX IoT graphics library part 2 - device independent bitmaps
21 Feb 2021 by Steffen Ploetz
My best practice approach to change the image of a toolbar button
27 Dec 2020 by Steffen Ploetz
Step-by-step instructions and source code snippets for inserting a bitmap (or a section of it) into an icon image.
9 Nov 2020 by OriginalGriff
Tell me this: if I have a cubic box of tomatoes and I sit on it - lowering it's height by half - are the tomatoes inside still all round and perfect? Of course not: I have reduced the volume of the box significantly, and squashed the fruits...
9 Nov 2020 by Member 14548583
I want to decrease width of image without losing its quality and without cropping it. When i am trying to decrease the width the image it becomes blurred. How can i resolve this? This is what i have tried so far. What I have tried: Dim...
1 Jun 2020 by Maciej Los
Quote: ...if the PDF has multiple pages my application only coverts and save them individually (one at a time) in which I have to repeatedly click the Save button before the next page from the PDF is saved, etc. Do you know what WYWIWYG acronym...
1 Jun 2020 by Member 14766911
I want to save files that are converted from a PDF to a PNG in a zip file. So far, I am able to convert a single PDF document into a PNG format, but if the PDF has multiple pages my application only coverts and save them individually (one at a...
20 Apr 2020 by OriginalGriff
We can't really tell, without running your code on your data - and we don't have access to either! So, it's going to be up to you. Fortunately, you have a tool available to you which will help you find out what is going on: the debugger. If you...
20 Apr 2020 by AskalotLearnalot
I am using Bitmap to water mark tif image files after it reach file number 440 the image size increases which results in a small text watermark. My method is designed to process large amount of files, it also checks if the image is colored or not...
6 Feb 2020 by phil.o
If you do not want it to close automatically, you can addConsole.WriteLine("Press a key..."); Console.ReadKey(); at the end of the Main method.
6 Feb 2020 by Member 14589606
I try to run the code, it doesnt tell the format but closes immediately, any ideas? The path is correct as it some times flashes the format and then closes using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using...
5 Feb 2020 by Member 14589606
How do I detect if an image is black What I have tried: The image which I want to detect is completely black
5 Feb 2020 by OriginalGriff
Look at the pixels (this may help: Bitmap.GetPixel(Int32, Int32) Method (System.Drawing) | Microsoft Docs[^] ) and compare them to Color.Black What did you expect us to tell you to do?
18 Jan 2020 by Marijan Nikic
Small tool for adding borders to image for canvas printing
1 Jan 2020 by Richard MacCutchan
The error is quite clear, you have run out of memory. You will need to modify your code so that it does not keep all the pages in memory. You could try saving each page as you process it so that it reduces the amount of memory in use at any time. Also, I am not sure why your Save method writes...
1 Jan 2020 by Member 13187373
I have 10MB+ Tiff files having 50 pages, and I want to perform rotation of all the pages by 90 degree at one click only, but after performing the rotation operations for each frames in foreach loop and when it comes to the Save(Encoder encoder) then here, encoder.Save(temporaryStream); //...
4 Jun 2019 by Member 14478761
I got the solution. I placed the code in the wrong place and misinterpret the error message. Thank you for your help.
4 Jun 2019 by Member 14478761
Hello, I would like to create an avi-file from a sequence of images. The images are stored as "cppBITMAP2.bmp" (during the loop the image gets updated). In this loop I want to create a video from these images. What I have tried: I found this: A simple interface to the Video for Windows API...
3 Jun 2019 by KarstenK
This isnt to hard, because AVI is a container format and you only need to init it and and some frames You may find some information in the article A class to easily generate AVI video with OpenGL and Video for Windows. Tip: the first pixel of the first frame (so the top-left) is setting the...
28 May 2019 by AntonioLeonardo
The imagem compression follow another objects and features that different of trivial files; image compreession has properties to equalize the compression. Like code bellow, the compression act on Quality property: static byte[] CompressByImageAlg(int jpegQuality, byte[] data) {...
28 May 2019 by MinYoung Lee
I've been trying to develop Remote Desktop Program in C# and I want to make the BYTE size of my Image smaller. Here is my attempt below so far. // int w = Screen.PrimaryScreen.Bounds.Width; int h = Screen.PrimaryScreen.Bounds.Height; ...
18 Apr 2019 by ilostmyid2
In the following code, I need to know whether I used a proper method for rendering frames obtained after decoding and rescaling. Besides, I get exception. I don't know what the exception is, since I see red x instead of images after some time. using System; using System.Collections.Generic;...
18 Apr 2019 by Fueled By Decaff
You are trying to perform UI(User Interface) operations on a thread that is not the UI thread. Either create and display the Bitmap in the backgroundWorker1_ProgressChanged method or use this.Invoke to execute code on the Form UI thread and generate the Bitmap and display it in the method...
18 Jan 2019 by RickZeeland
Here are some sites: https://www.slant.co/improve/topics/10369/~platforms-where-i-can-recruit-freelance-teams[^] https://www.slant.co/improve/topics/11977/~sites-to-find-post-a-job[^]
19 Dec 2018 by Member 13664349
Hi, I have a scanned image which contains some multiple-choice questions. So, first of all how could I calculate the average color for most pixels inside a specific circle (I already know how to get the color of one individual pixel I only need help with the algorithm) Please Note I already...
18 Dec 2018 by User 11060979
This is not an easy field and you Need to dive in deep into the theory. I would suggest you this as a start: Redirect Notice[^] Please note the above article is only a start and it descibes the "most" complex case. In case you have not a photography, but a scanned document I suggest to read...
18 Dec 2018 by Member 13664349
Hi, I am working on a program which is able to get the answers from a multiple-choices questions just like SAT. So in order to determine which Answer was selected I thought about getting the color of specific pixels (If pixel color is nearly black that menas this choice is selected...) But...
18 Dec 2018 by OriginalGriff
Repost, again. When you asked this question yesterday: Any ideas for scanning multiple choices answers?[^] I told you that the answer hadn't changed since the day before: How to crop an image in an appropriate way, C#?[^] I repeat: the answer doesn't change just because you don't like it.
17 Dec 2018 by OriginalGriff
And how does this differ in any material way from your last question: How to crop an image in an appropriate way, C#?[^] The solution you have been given does not change just because you don't like the answer!
17 Dec 2018 by RickZeeland
See these CodeProject articles: Cropping Images[^] Image Rotation in .NET[^] And here's a WPF version: Rotating and cropping an image in WPF - Pete Brown's 10rem.net[^] And here's a cross platform .NET Core library: GitHub - SixLabors/ImageSharp: A cross-platform library for the processing of...
1 Nov 2018 by MartinXLord
I have now tested this with Visual Studio 2017 Compiles OK - no error message
1 Nov 2018 by MartinXLord
clone(Bitmap,format) Compiler say there is no overload that takes 2 arguments Microsoft docs describes the method ( with 2 arguments) for net frameworks 1.2 to 4.7.2 (Bitmap.Clone Method (System.Drawing) | Microsoft Docs[^]) I am using framework 4.5 and visual studio 2012 Express I have...
31 Oct 2018 by F-ES Sitecore
You're missing some parenthesis. newImage = ((Bitmap)image).Clone(sRec,PixelFormat.Format16bppArgb1555); In your original code "(Bitmap)image.Clone" You are calling the Clone method on whatever type image is, you're not calling it on image cast to Bitmap. By adding the parenthesis you are...
31 Oct 2018 by MartinXLord
Edit the source line is:- newImage = (Bitmap)image.Clone(sRec,PixelFormat.Format16bppArgb1555); newImage is defined in the class Form1 : Form by:- "Bitmap newImage = null;" The compiler message was:- 'Error: No overload for method "Clone" takes 2 arguments'
13 Oct 2018 by Steffen Ploetz
How to use GL's pixel buffer object (PBO) to copy one texture to another
11 Sep 2018 by Member 13981298
Need to print labels on a GlControl box for a graph. This can be done easily with Glut. However, OpenGL.Net does not seem to support GLUT. What I have tried: Tried writing the string on a bitmap and then print it on the Glcontrol but it prints some garbage value. The application is in WinForm....
9 Sep 2018 by jung-kreidler
Probably a little bit late, but it might help others. No, there's no need for another toolbar. When creating a toolbar the bitmap is loaded to a CMFCToolBar internal object, which can be reset by CleanUpLockedImages. After this another bitmap can be loaded with a call to LoadBitmap (same as...
7 Sep 2018 by iDebD
//CMFCToolBar m_wndToolBar;if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) || !m_wndToolBar.LoadToolBar(theApp.m_bHiColorIcons ? IDR_MAINFRAME_256 : IDR_MAINFRAME)) { TRACE0("Failed...
3 Sep 2018 by Shahzad Naseer
I want to save Gradient object as Cbitmap. The Function MakeDiagnolGradientBitmap() saves Diagnol Gradient. I Simply want to save Vertical Gradient. void CButtonST::MakeDiagnolGradientBitmap() { CPaintDC dc(this); CRect rect; GetClientRect(&rect); int r1 = 245, g1 = 245, b1 = 245; int...
3 Sep 2018 by Richard MacCutchan
See Saving CBitmap as a .bmp file in MFC[^]
2 May 2018 by Member 13795231
Hello, I am facing a problem with drawing Newton's fractal for f(x) = x^3 - 1 using F# The problem is that my program seems to draw only the down right 1/4 of the fractal and nothing else. Since the actual drawn area is correct, I take it as the problem might be with the bitmap representation on...
8 Mar 2018 by Member 13376650
I am trying to take a photo from the phone's camera, then pass it to tesseract engine and write the result on a text view by the code you can see in the following. MainActivity: package com.example.arbazalam.myapplication; import android.Manifest; import android.content.Intent; import...
4 Jan 2018 by Amedora Ahmed
I am reading binary data image from a serial port device how can i write it to a black and white image file. The project is a bill counting machine which solution. the device scans images of serial number of bill counted including the data counter Below is the data returned from the device as...
31 Dec 2017 by kkdxghlctlcxxtidyuum
Hello, After installing a new distribution of GNU/Linux, I found that various applications were using a different icon set for their MenuStrips and ToolBars. My old distribution used the GTK+ icon set (Debian), my new distribution uses the Mint-X icon set (Linux Mint). My question is: how does...
31 Dec 2017 by Richard MacCutchan
See How to Set the Look and Feel (The Java™ Tutorials - Creating a GUI With JFC/Swing - Modifying the Look and Feel)[^]
4 Dec 2017 by Member 13291388
I create a device independent bitmap on a layer window in c++, and this bitmap shows above window correctly. But the problem is that it is hidden by child of window. How to set DIB as top display even we create many window on the same time? Do have any command for setup bitmap as top show on all...
4 Dec 2017 by KarstenK
You must draw that bitmap in your top-most window. When you open a new sub window check whether it is top most and draw it. For convinience it is best to use a global pointer to get access to your bitmap. Creating a lot of windows isnt a good idea because it confuses the users and I see it as...
3 Dec 2017 by completeknowitall
Um.. I thought I understood scan line... but when I step through the code, the source pointer remains empty and nothng gets transferred. I you have any advice, I'm listening. this is the core of my code, I'm hoping to do stuff to the pixels between reading and writing, but this part doesn't...
13 Sep 2017 by Member 13373000
I am working with COM Interface of a software, OMICRON MPD 600 to be particular. I would like to take a screenshot using the provided methods however it returns the image as DIB populated inside byte array. How can use this byte array to save this screenshot as an image. I would prefer DIB to...
13 Sep 2017 by Graeme_Grant
There is an article right here on Code Project that will answer this for you: DIB to System.Bitmap[^]
29 May 2017 by CPallini
As already noted you usually can't gain much trying to compress a JPEG image, which is alreay compressed. In your code you changed the image size, making it smaller. If it is acceptable to make it even more smaller, then you may save some memory.
29 May 2017 by OriginalGriff
Not really: JPEG files are already compressed, and further compression often makes them larger, not smaller. You're already using ZIP compression, but it's unlikely to produce significant gains on a JPEG file anyway. If you get an extra 10% then you were doing well. But...you do realise that...
4 May 2017 by Toni_s
Hi all. I have a question about how to play animation without to use too much memory. I want to load in every Timer Tick only one frame directly from the disk, without to load all frames into memory in a variable. I have make one function for this, but if i called it slows down in every frame a...
16 Jan 2017 by EsakkiRaja
Hi all,I am trying to draw a line over the live video streaming in direct show application. Am successfully drawing a line but if I continuously want to create a line by calling the below function, i got an error E_OUTOFMEMORY from the SetAlphaBitmap(). Am calling drawlineOverlay() function...
16 Jan 2017 by KarstenK
Create and populate the bitmap and the other stuff once at program start. These operations are "expensive" so do them as less as possible.//Gobal bitmapBITMAP bm = {0};// init with zerosvoid drawlineOverlay(HWND m_hwndApp){ //run code once if( bm.bmWidth == 0 ) { // set...
28 Dec 2016 by learnasucan
Actually I have written a code to select image from gallery,but I dont know how to draw or write a text by hand on it.and Edited image should be saved separately in sdcard.Basically I have to make basic paint app where canvas will be my selected image,and my touch is input to draw a circle or...
24 Nov 2016 by JeSuisMathieuNault
I am trying to use Bitmap but I get instant errortryingusing System.Drawing.Bitmapand keep getting Error CS0246 The type or namespace name 'Bitmap' could not be found (are you missing a using directive or an assembly reference?) BitMap D:\Data\3M Machines\My Machines\Programmation...
24 Nov 2016 by OriginalGriff
You don't add a using statement for individual classes, just the namespace they are in:using System.Drawing;You can then use the class:Bitmap bm = (Bitmap) Bitmap.FromFile(@"D:\Temp\MyImage.bmp");
24 Nov 2016 by F-ES Sitecore
You only include the namespace in the "using", not the class nameusing System.DrawingIf you're struggling to even create a class you're really going to struggle doing anything more advanced. I'd get a book on c# and start learning the basics before moving on to anything else.
4 Oct 2016 by Arun Chandrasekhara Pillai
Create a screen recorder using C#
28 Sep 2016 by Member 12766129
I have a form with OpenFileDialog for selecting image and showing it in pictureBox. Until the form is open the user can open and then save the opened image as many times as he wants.But when he secont time open openfiledialog the picture show but the both image show in same location,I want the...
24 Aug 2016 by Isaac RF
To create visually engaging apps, displaying images is a must. Learn to display Bitmaps Efficiently on your Android apps, without giving away performance. The post Displaying Bitmaps Efficiently on Android apps appeared first on Isaac RF.
20 Aug 2016 by binaryoffset
Hello. I am trying to copy and save the contents of a Bitmap class image to a *.bmp file but currently receive Unhandled Exceptions during run-time of the console program. I would be grateful to learn where the error lies and how to fix this program. Thank you.Below is the main part of the...
20 Aug 2016 by Afzaal Ahmad Zeeshan
This generic exception is the worst exception that one can get while working with graphics objects. It just simply doesn't provide anything at all. Quote:An unhandled exception of type 'System.Runtime.InteropServices.ExternalException' occurred in System.Drawing.dll Additional information: A...
20 Aug 2016 by KarstenK
You dont respect the file format of bmp files. At the beginning is written the bitmap header, than optional some palette (mapping) data and than the pixels. You easily can fetch some information in the wikipedia article about bmp file format.The legendary article CxImage handles the bitmap...
13 Aug 2016 by Member 12684118
HI,codeprojectersi have a question how would i put a bitmap on my button in dynamic library the bitmaps needs to be in /themes/ for who want a costum buttonWhat I have tried:I tried loadbitmap and etc but it didnt work
13 Aug 2016 by Member 12684118
Do you have any example on how to do it and display the image on the button??
13 Aug 2016 by Jochen Arndt
If LoadBitmap() fails call GetLastError() to know the reason for the error.Loading a bitmap from file (especially by a dynamic library) is a bad idea because you have to hard code the path to the file. For this reason I expect the error code to be 2 (ERROR_FILE_NOT_FOUND).A better...
5 Aug 2016 by User 6976447
I am using a custom class to write an image onto another image of bigger size.I am using a custom class to write an image onto another image of bigger size.doc - Google Drive[^]public class BitmapLockerTest{ private static string path = @"locker.png"; public static void...
11 Jul 2016 by User 6976447
I wrote the following methods, public static byte[] BitmapToByteArray(Bitmap image) { byte[] returns = null; if (image.PixelFormat == PixelFormat.Format8bppIndexed) { BitmapData bitmapData =...
10 Jul 2016 by User 6976447
I want to convert a Bitmap image into a 2D array of integers and vice versa.I have written the given code.And, this is my driver program:private void forwardFftButton_Click(object sender, EventArgs e) { Bitmap grayscale = (Bitmap)...
10 Jul 2016 by Patrice T
You should learn to use the debugger as soon as possible. Rather than guessing what your code is doing, It is time to see your code executing and ensuring that it does what you expect.The debugger allow you to follow the execution line by line, inspect variables and you will see that there...
6 Jul 2016 by User 6976447
I have written a test program and loaded a PNG image into it,https://dotnetfiddle.net/XHwp7oPixel format = 32 bit colorResolution of the Bitmap,Width = 512 pixelsHeight = 512 pixelsStride of the Bitmap = 2048 pixelsOffset or Padding = (Stride - Width) = (2048 - 512) = 1336...
6 Jul 2016 by Midi_Mick
Firstly, there are a few things to note in your report of the bitmap attributes: 1. Stride is usually reported in bytes, not pixels. 2. Each pixel is 4 bytes (32 bits). 3. This means that your offset or padding will be 0 (2048 bytes - 512*4 bytes).Each row of your bitmap...
15 May 2016 by oronsultan
in my wpf application, the user can upload an image. Now, when the image is not centered and the background is transparent, i want to crop the image. is it posiible?What I have tried:.......................................................................................
30 Apr 2016 by ByeByeByeByeBye
how would I change the wallpaper with C# back to a known path of a bitmap or remove the wallpaper for good? Is there any command for it. A SendKeys Combo would be fine.Can't access my wallpaper settings manually any longer, it's been greyed out all options and I have a strange bitcoin...
30 Apr 2016 by Richard MacCutchan
See also Wallpaper Changer[^].
8 Apr 2016 by V.
Convert FITS file to known image formats and use those images for a "zooming" functionality (image transparency)
27 Mar 2016 by Sascha Lefèvre
Quote:Others say that although this is important, they don't actually do much in terms of memory issues.When not using using-statements the CLR eventually comes around to cleaning up those objects but there's no guarantee on when this will happen. So it can lead to inconsistent behaviour. When...
27 Mar 2016 by Xenac
HelloI am trying to create a tile editor application that joins 16x16 sized png images into one large png file. I have tried this before when trying to develop other applications and have failed to get around the issue of memory leakage or just general GDI+ errors.Now I know this isn't...
6 Mar 2016 by Jakub Szymanowski
The article presents idea and implementation of Fourier Transform (DFT and FFT algorithms) in Digital Signal Processing.
5 Jan 2016 by Dave Kreskowiak
I haven't touched C++ in about 5 years and I've never even heard of Embarcadero, but... it looks like your cast is being applied to the wrong item. Shouldn't it be something like:Sbyte = (TRBGTriple *)(Source->scanline[y]);
4 Jan 2016 by KarstenK
your main and obvious bug is a typo in the inner loop: if((PixelArray[offset] != 255 ) && (PixelArray[offset+1] != 255) && (PixelArray[offset+2] != 255)) { //it is asked to use this RGB value (69,106,671) // 671 WTF??? PixelArray[offset] = 69; PixelArray[offset+1] =...
26 Dec 2015 by Member 12229315
Hello and Merry Christmas ! I've made a program that overwrites all the colors from a 24bit bitmap (except for white) with a given one (it is said that the background is white) . The problem is that i can't remove the padding . I've read bunch of tutorials and questions and still can't manage to...
13 Dec 2015 by أحمد بن حنبل
Hello as you can see in next picture I am working on plate localization , now I want to write vb.net or c# code to locate the blue regionsand then I will create list of images contains all blue regions but from original image , just i need from you to help me to locate the blue regions on...
30 Nov 2015 by khamis
Hi, I'm not pro. in that area but we are using LibTiff.Net 2.4 and it work just perfice with us.I hope that will help.
8 Nov 2015 by Gyaneswar kumar
use use the snipping tool with below details as:http://windows.microsoft.com/en-in/windows/use-snipping-tool-capture-screen-shots[^]
8 Nov 2015 by dedo lore
Hi,i want to take continuously screenshots from five different positions on my desktop very fast. The CopyFromScreen mothod is unfortunately to slow.I found:Very fast screen capture using DirectX in C#[^]but i dont know:- how to take a screenshot with directX on my secondary...
4 Nov 2015 by bling
Your paint handler looks strange to me. private void Form1_Paint(object sender, PaintEventArgs e) { gDisplay.DrawImage(bitmap, new Point(0, 0)); }Try this:private void Form1_Paint(object sender, PaintEventArgs e){ ...