image-formats

TBitmap32.LoadFromStream() Auto-Recognize Image Format

孤人 提交于 2020-01-14 10:23:23
问题 I'm using Delphi XE2 (Update 3) and GR32. I am unable to use TBitmap32.LoadFromStream() to load the image data. It raises the following exception: Project MyApp.exe raised exception class EInvalidGraphic with message 'Bitmap image is not valid'. Code uses GR32, GifImg, PngImage, Vcl.Graphics; var pic: TBitmap32; bs: TBytesStream; begin bs := TBytesStream.Create(TClientDataSet(cds).FieldByName('filedata').AsBytes); try pic := TBitmap32.Create; try // bs.SaveToFile('c:\delme.png'); // pic

Save frame from TangoService_connectOnFrameAvailable

大憨熊 提交于 2019-12-31 05:52:30
问题 How can I save a frame via TangoService_connectOnFrameAvailable() and display it correctly on my computer? As this reference page mentions, the pixels are stored in the HAL_PIXEL_FORMAT_YV12 format. In my callback function for TangoService_connectOnFrameAvailable, I save the frame like this: static void onColorFrameAvailable(void* context, TangoCameraId id, const TangoImageBuffer* buffer) { ... std::ofstream fp; fp.open(imagefile, std::ios::out | std::ios::binary ); int offset = 0; for(int i

Dynamically add text in an image on Xaml/Windows Phone

喜你入骨 提交于 2019-12-23 04:53:44
问题 I have a XAML ListBox where I am implementing an Image beside that a block of text is there. I want to display a count text in that image. For example for the first block in the image I want to display 1, for the 2nd block I want to display 2. This goes on. Below is the snippet. Can anybody please help me how can I write the count numbers in the image? <StackPanel Grid.Column="0"> <Image Source="/Assets/Images/pin.png"></Image> </StackPanel> <TextBlock Name="locationID" Visibility="Collapsed"

Using python to save a JPG image that was edited in the script

痴心易碎 提交于 2019-12-12 04:54:44
问题 Referring to the answer to this question, I tried to save my own JPG image files, after some basic image processing. I've only applied a rotation and a shear. This is my code: import numpy as np import sys from skimage import data, io, filter, color, exposure import skimage.transform as tf from skimage.transform import rotate, setup, AffineTransform from PIL import Image mypath = PATH_TO_FILENAME readfile = FILENAME img = color.rgb2gray(io.imread(mypath + readfile)) myimg = rotate(img, angle

Displaying .tif images in the asp:Image control of ASPNET

北城以北 提交于 2019-12-12 01:27:44
问题 I have been given a bunch of ".tif" image files that should be displayed on to my .aspx pages. Although i can see these images in design time. The asp:Image fails to render the image(.tif) on the browser. If i use a .jpg file instead of tiff image, it renders perfectly. Any ideas why this is a limitation ? Things i tried To have a Handler file SampleHandler.ashx in my project which does the processing of the request public void ProcessRequest(HttpContext context) { string path = context

OpenCV imencode pgm doesn't encode the correct format

走远了吗. 提交于 2019-12-11 19:45:44
问题 I am trying to encode a Mat CV_32FC1 image to send it over the internet with base64, the process works but the OpenCV encodes in the wrong format. Example: vector<unsigned char> buffer; vector<int> compression_params; compression_params.push_back(CV_IMWRITE_PXM_BINARY); compression_params.push_back(0); cv::imencode(".pgm", desc, buffer, compression_params); printf("%s", &buffer[0]); This generates the following output: P2 64 15 255 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 etc..

How can I convert between RGB565 and RGB24 image formats in MATLAB?

自作多情 提交于 2019-12-09 17:00:45
问题 I am getting an RGB matrix from a microprocessor that outputs an image in RGB565 format. I want to read this into MATLAB, convert it to RGB24 format, and output the image. How do I do this? 回答1: You first have to read your data from the text file into a matrix in MATLAB. Since I don't know what format your text file is in, I can only suggest that you will probably need to use the function fscanf to read in all of your values (probably of type uint16), then you will likely have to reshape the

Convert YV12 to NV21 (YUV YCrCb 4:2:0)

匆匆过客 提交于 2019-12-08 08:42:13
问题 How can you convert: YV12 (FOOURCC code: 0x32315659) to NV21 (FOURCC code: 0x3132564E) (YCrCb 4:2:0 Planar) These are both common formats for Android video handling, but there is no example online converting directly between the two. You can go through RGB but I assume that will be too inefficient. Ideally in C# or Java , but can convert code from whatever else... The input is a byte[] , and the width and height are known. I have been trying to follow the Wikipedia Article but cannot get it

Png Image support of J2ME WTK Emulator

孤者浪人 提交于 2019-12-08 01:32:24
问题 I use a png image in my project that is not displayed in emulator but it can be displayed in phone. Then i open it with photoshop, save as png and use that image. It is displayed both emulator and phone. I couldn't figure out the difference of original and edited one. And is there any setting of emulator for image display? And how can i understand any png file is supported or not? original image edited image 回答1: I preferred PNG files is good for MIDP. You can check following links, It will

Png Image support of J2ME WTK Emulator

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 15:53:58
I use a png image in my project that is not displayed in emulator but it can be displayed in phone. Then i open it with photoshop, save as png and use that image. It is displayed both emulator and phone. I couldn't figure out the difference of original and edited one. And is there any setting of emulator for image display? And how can i understand any png file is supported or not? original image edited image I preferred PNG files is good for MIDP. You can check following links, It will helps you. What image types does MIDP support? Image Formats in J2ME 来源: https://stackoverflow.com/questions