bitmapimage

C++: rotate image BMP

前提是你 提交于 2019-12-13 22:03:40
问题 I have some serious problems with this stupid rotation function of a BMP image... I've already post the same question now 2 days ago, I know... But no one could make me to understand what's happening here and how can I solve this issue. EDIT: that image will be rotated just with 90 degrees multipler. In this moment I'm trying to rotate this image with an 180 degree And here it's my result until this moment Here it's my code: #include <algorithm> #include <fstream> #include <math.h> #include

Write hidden messages to image file c#

旧城冷巷雨未停 提交于 2019-12-13 12:23:21
问题 I was looking for a tutorial where is described how to write/read hidden text into image file using C#, but unfortunately I din;t find any good posts about this, so I decided to ask here about this small trick. Suppose I have an image file called test.jpg , is there any way to write an hidden text like "Hello word " to this file ? I have read about image metadata , and I suppose that I should try to write somehow to this metadata , but I din;t find how. If anybody know how to do it , please

Get file Thumbnail image with transparency

空扰寡人 提交于 2019-12-13 04:32:14
问题 I want to get file's thumbnail with transparency. I have the following code to achieve it: BitmapImage GetThumbnail(string filePath) { ShellFile shellFile = ShellFile.FromFilePath(filePath); BitmapSource shellThumb = shellFile.Thumbnail.ExtraLargeBitmapSource; Bitmap bmp = new Bitmap(shellThumb.PixelWidth, shellThumb.PixelHeight, System.Drawing.Imaging.PixelFormat.Format32bppPArgb); BitmapData data = bmp.LockBits(new System.Drawing.Rectangle(System.Drawing.Point.Empty, bmp.Size),

BitMapImage to byte and reverse

若如初见. 提交于 2019-12-13 01:59:23
问题 Since two days I try to manage my images in a WPF application but I have errors and errors errors, ... The image is show in a System.Windows.Control.Image. For this reason I try to work with variable BitMapImage. Now I have the error : "Impossible to access close stream" and I can not find a solution. I have created two function for convert : public static BitmapImage ConvertToBitMapImage(byte[] bytes) { if (bytes == null || bytes.Length == 0) return null; var image = new BitmapImage(); using

C/C++ rotate an BMP image

人盡茶涼 提交于 2019-12-12 18:47:56
问题 I'm trying to rotate an BMP image using C/C++ but it's not working. I've made some functions for read, write and rotation. The read and write functions are working perfectly fine but not rotate from some reason. EDIT(sin, cos and rotate function) BMP struct: struct BMP { int width; int height; unsigned char header[54]; unsigned char *pixels; int size; }; WRITE: void writeBMP(string filename, BMP image) { string fileName = "Output Files/" + filename; FILE *out = fopen(fileName.c_str(), "wb");

detecting qr code then rotating document

半城伤御伤魂 提交于 2019-12-12 18:27:38
问题 Good evening all wonderful helpers, I am trying to detect a QR code that I have on a scanned PDF(printed pdf with qr then scanned) The QR code will always be located on a corner of the file. Here in my following code I clone the area of which the QR is located. Help on: - looking over the document to see which corner has an image (qr) - after finding the corner that has the qr code - rotate the file so that the qr code would be located on the top left corner. Code: for (int pg = 0; pg <

How can I convert byte[] to BitmapImage?

纵然是瞬间 提交于 2019-12-12 10:31:02
问题 I have a byte[] that represents the raw data of an image. I would like to convert it to a BitmapImage . I tried several examples I found but I kept getting the following exception "No imaging component suitable to complete this operation was found." I think it is because my byte[] does not actually represent an Image but only the raw bits. so my question is as mentioned above is how to convert a byte[] of raw bits to a BitmapImage . 回答1: When your byte array contains a bitmap's raw pixel data

Out of memory exception while loading images from isolated storage

爷,独闯天下 提交于 2019-12-12 09:17:43
问题 I am getting OutofMemoryException in this particular code. public BitmapImage GetImage(int pageNo) { if (!this._isLoaded) { this.Load(); } using (IsolatedStorageFileStream stream = IsolatedStorageFile.GetUserStoreForApplication().OpenFile(this.FileNames[pageNo], FileMode.Open, FileAccess.Read)) { BitmapImage image = new BitmapImage(); image.SetSource(stream); return image; } } The out of memory exception is occuring at image.SetSource(stream) . I cant set the uri to null because I have to

Saving PNG image to Isolated Storage for WP7

扶醉桌前 提交于 2019-12-12 08:16:24
问题 There has been quite a few image-to-isolated-storage questions here, but I couldn't find a good answer for my situation - so here we go. I am fetching a .png image from the web, and saving it as a BitmapImage -object. When it's done loading (on the BitmapImage.ImageOpened event), I want to save it to isolated storage. So, how can I get the bytes or file stream from this BitmapImage (or directly from the web - doesn't matter) so that I can write it to my IsolatedStorageFileStream ? I can't

Android - SkImageDecoder::Factory only when i read image with extension .png

自古美人都是妖i 提交于 2019-12-12 06:13:46
问题 In my Android app i have to read a lot of images, for this reason i have implemented image caching. This is the method through which i decode my images(that were stored in the assets/ folder): private Bitmap getBitmapFromAsset(String strName) { AssetManager assetManager = context.getAssets(); InputStream istr = null; try { istr = assetManager.open(strName); } catch (IOException e) { e.printStackTrace(); } return decodeFileFromAssets(istr); } private Bitmap decodeFileFromAssets(InputStream