bmp

Javax ImageIO IIOException for apparently no reason

前提是你 提交于 2019-12-04 05:43:38
问题 Hey all, I have a Java problem. For my senior research class, I'm pretty much finished but I just have to analyze some data in images I generated. I don't want to tag this as homework because it's not part of any required assignment...it's something I came up with on my own to collect results. I wrote a program that compares two images pixel by pixel. It does this for all .bmp files in two directories. Now, my program reads the filenames into a String array and I checked the values of all the

Issue while saving image using savefiledialog

我怕爱的太早我们不能终老 提交于 2019-12-04 04:58:09
问题 I'm using savefiledialog to save an image. Canvas is picturebox and the loaded image is bitmap. When I try to save it the file is created but somehow corrupted. Cause when I try againt load the image or show in different viewer it doesn't work - I mean the saved file is corrupted. There is an method for saving image. private void saveFileDialog1_FileOk(object sender, CancelEventArgs e) { System.IO.FileStream fs = (System.IO.FileStream)saveFileDialog1.OpenFile(); try { switch (saveFileDialog1

Replacing icon in Windows *.exe from open-source platform-independent Java code

社会主义新天地 提交于 2019-12-04 03:53:43
First of all, this is not a duplicate of the very common question of making an EXE from Java classes. I do not need to do that. To solve NetBeans RFE #64612 without manual steps I need a Java (6+) library which can take an existing Windows *.exe file and replace its icon with a substitute in a common format. The executable, which is generic and prebuilt (distributed in binary form), already knows how to load an application-specific config file and then start the JRE with various application JARs etc.; the only problem is that it has a generic icon, and I would like to replace that icon as part

Why doesn't ImageIO read a BMP file until it is re-saved in MS Paint?

微笑、不失礼 提交于 2019-12-03 20:04:51
问题 I have a bitmap file, test3.bmp , which I can view and edit with every image viewer I have tested with. That said, I cannot read it into my Java application. If I edit the BMP in MS Paint, save it, undo the change, and save it ( test3_resaved.bmp ), I have the same image, but with a different file size. The different file sizes do not concern me... what does, is that my application can read the re-saved file. Could anyone enlighten me on why one image works with my code but the other does not

Why does fread mess with my byte order?

拟墨画扇 提交于 2019-12-03 18:51:14
问题 Im trying to parse a bmp file with fread() and when I begin to parse, it reverses the order of my bytes. typedef struct{ short magic_number; int file_size; short reserved_bytes[2]; int data_offset; }BMPHeader; ... BMPHeader header; ... The hex data is 42 4D 36 00 03 00 00 00 00 00 36 00 00 00 ; I am loading the hex data into the struct by fread(&header,14,1,fileIn); My problem is where the magic number should be 0x424d //'BM' fread() it flips the bytes to be 0x4d42 // 'MB' Why does fread() do

reading a .bmp file in c++

帅比萌擦擦* 提交于 2019-12-03 09:47:06
问题 I'm trying to load a bmp file for reusing it in opengl. I've found some code via google on how to load a bmp file. I took this code and put in a class Bitmap in my project. The class is far away from being finished but already the reading of the file headers goes wrong. After reading the bytes for INFOHEADER and FILEHEADER there aren't the right values in my structs. Some ideas? // // Bitmap.h // #ifndef LaserMaze_Bitmap_h #define LaserMaze_Bitmap_h typedef struct /**** BMP file header

reading a .bmp file in c++

女生的网名这么多〃 提交于 2019-12-03 03:09:13
I'm trying to load a bmp file for reusing it in opengl. I've found some code via google on how to load a bmp file. I took this code and put in a class Bitmap in my project. The class is far away from being finished but already the reading of the file headers goes wrong. After reading the bytes for INFOHEADER and FILEHEADER there aren't the right values in my structs. Some ideas? // // Bitmap.h // #ifndef LaserMaze_Bitmap_h #define LaserMaze_Bitmap_h typedef struct /**** BMP file header structure ****/ { unsigned short bfType; /* Magic number for file */ unsigned int bfSize; /* Size of file */

python bmp转换为jpg 并删除原图

匿名 (未验证) 提交于 2019-12-02 22:54:36
# coding:utf-8 import os from PIL import Image # bmp 转换为jpg def bmpToJpg ( file_path ): for fileName in os.listdir(file_path): # print(fileName) newFileName = fileName[ 0 :fileName.find( "_" )]+ ".jpg" print (newFileName) im = Image.open(file_path+ " \\ " +fileName) im.save(file_path+ " \\ " +newFileName) # 删除原来的位图 def deleteImages ( file_path , imageFormat ): command = "del " +file_path+ " \\ *." +imageFormat os.system(command) def main (): file_path = "D: \\ VideoPhotos" bmpToJpg(file_path) deleteImages(file_path, "bmp" ) if __name__ == '__main__' : main() 文章来源: python bmp转换为jpg 并删除原图

What is wrong with this code for writing grey-scale bmp from an image RGB bmp pure C - Windows OS

匆匆过客 提交于 2019-12-02 22:49:28
问题 This is my function, I am using the headers BMP according to wikipedia BITMAPINFOHEADER. But, I am getting a file without any image...when putting padding, the process stops. // Structures for header info #pragma pack(push,1) /* Windows 3.x bitmap file header */ typedef struct { char filetype[2]; /* magic - always 'B' 'M' */ unsigned int filesize; short reserved1; short reserved2; unsigned int dataoffset; /* offset in bytes to actual bitmap data */ } file_header; /* Windows 3.x bitmap full