bmp

C# Console Application - How to draw in BMP/JPG file using GDI+?

无人久伴 提交于 2019-12-07 12:22:36
问题 I want to draw shapes like rectangles, arrows, text, lines in a BMP or JPG file, using a C# Console Application and GDI+. This is what I found on the web: c# save System.Drawing.Graphics to file c# save System.Drawing.Graphics to file GDI+ Tutorial for Beginners http://www.c-sharpcorner.com/UploadFile/mahesh/gdi_plus12092005070041AM/gdi_plus.aspx Professional C# - Graphics with GDI+ codeproject.com/Articles/1355/Professional-C-Graphics-with-GDI But this still doesn't help me. Some of these

How to read a .bmp file identify which pixels are black in Java

喜你入骨 提交于 2019-12-07 10:16:56
问题 Something like the following... except making it work: public void seeBMPImage(String BMPFileName) throws IOException { BufferedImage image = ImageIO.read(getClass().getResource(BMPFileName)); int[][] array2D = new int[66][66]; for (int xPixel = 0; xPixel < array2D.length; xPixel++) { for (int yPixel = 0; yPixel < array2D[xPixel].length; yPixel++) { int color = image.getRGB(xPixel, yPixel); if ((color >> 23) == 1) { array2D[xPixel][yPixel] = 1; } else { array2D[xPixel][yPixel] = 1; } } } }

Delphi 2007 using Windows Imaging Component (WIC)

谁都会走 提交于 2019-12-07 04:41:11
问题 I need to read and convert some pictures around 1.7mb from jpg to bmp in Delphi 2007. Some pictures are cut out, grayscale or worst after conversion. I searched, but in no way i found a trick to add WIC routines like TWicImage in delphi 2007. I read somewhere that it can be easily added via COM, but I do not know how or what file has to be imported. Thank you. 回答1: Here is an example how to convert JPEG to bitmap using WIC: unit Unit1; interface uses Windows, Messages, SysUtils, Variants,

Converting animated .gif file into a .bmp strip

时间秒杀一切 提交于 2019-12-06 16:49:24
问题 I was wondering if someone can direct me or guide me in order to use a .gif image and convert it into a .bmp strip image file. 回答1: First, you need to get the gif's size. Then you need to find out how many frames there are. After that you need to create a new image with Height = original height, and Width = Frames * Gif Width. Then you must paste the original Gif's frames into the strip like so: Frame N starts at pixel N*Width. That is if you're making a horizontal strip. And here is the

Creating a custom file-type in C++

时光怂恿深爱的人放手 提交于 2019-12-06 13:40:26
问题 I am making a level editor that needs to output a custom map file for use with source code that I will write for a graphics library. My question is: What do I need to bear in mind when deciding how to structure a custom file type? Also how can I encode a standard bitmap image into my file (the tile set) so that it can all be contained in a single file rather two files; the map file and tile set (.bmp file). Thanks. 回答1: First you need to design your file layer, you need fixed size data to

How to get bmp image from from binary blob data with php

☆樱花仙子☆ 提交于 2019-12-06 13:29:28
I'm trying for 2 days to find a way to retrieve some images from a database. They are saved as a binary string (I read the term somewhere, but frankly never heard before). Most of the images are in .jpeg format and is easy to get and save to a file. but my problem is the .bmp images. For some reason i can't show then. For now, i'm using a simple code just to get the image and save it to a file: $img = $row['image']; file_put_contents("file.jpeg", $img); //Doesn't matter what format i put there. Works fine in .jpeg and .png , but .bmp formats are unreadable when i try to display. Things i

How to use ColorQuantizerDescriptor?

江枫思渺然 提交于 2019-12-06 13:23:15
Following the idea of @PhiLho's answer to How to convert a BufferedImage to 8 bit? , I want to use ColorQuantizerDescriptor to convert a BufferedImage , imageType TYPE_INT_RGB, but RenderedOp#getColorModel() is throwing the following exception: java.lang.IllegalArgumentException: The specified ColorModel is incompatible with the image SampleModel. at javax.media.jai.PlanarImage.setImageLayout(PlanarImage.java:541) at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:878) at javax.media.jai.RenderedOp.getColorModel(RenderedOp.java:2253) This is the code that I am attempting to use:

How to convert UIImage to BMP and save as Data (not JPG or PNG)

梦想与她 提交于 2019-12-06 12:45:27
I am syncing BMP images between my iOS app (Swift 3) and an app (on MS Windows) that supports only BMP format. BMP images created on the MS Windows app are downloaded as base64 strings, saved as Data and displayed quite easily using some lines of code like: let imageData = Data(base64Encoded: value) let image = UIImage(data: imageData) This is generating a UIImage from downloaded BMP image and works perfectly because I cas display the image. But I also need to create BMP images (drawn signatures) from the iOS app and for that, I'm using this library https://github.com/felipesantolim

Convert PPM to JPG or BMP in java

陌路散爱 提交于 2019-12-06 10:48:25
I need to know how feasible is it to write a function in java to read a ppm file and convert it to jpg or bmp format. Anyone has experience with this? I am able to achieve the goal using tools such as ImageMagick but I want to do it in pure Java way. I would search for ImageMagick Application Programmer Interfaces. They have interfaces for every significant language. I find the Java philosophy is to extensively research what already exists, find the best solution for your needs, then write the minimal code needed to interface to it. This is a pure Java way. SubOptimal Beside the old Sun JAI

Remove bmp header to encrypt

北战南征 提交于 2019-12-06 07:49:09
I'm pretty new to C# and got handed this AES encryption project on images. There's probably a very simple thing that I'm missing here. I'm trying to remove the header from a bmp and encrypt the rest then add the header back. If I don't remove the header the program works well. To remove, I tried this (bmp header is 54 bytes): MyImage = new Bitmap("path"); MemoryStream ms = new MemoryStream(); MyImage.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); byte[] Header=null, picture=null, pictureFull = ms.ToArray(); for (int i = 0; i < pictureFull.Length; i++) { if (i < 54) { Header[i] = pictureFull