bitmap

How to concatenate icons into a single image with ImageMagick?

I want to use CSS sprites on a web site instead of separate image files, for a large collection of small icons that are all the same size. How can I concatenate (tile) them into one big image using ImageMagick? ...

How to create a very big bitmap in C++/MFC / GDI

I'd like to be able to create a large (say 20,000 x 20,000) pixel bitmap in a C++ MFC application, using a CDC derived class to write to the bitmap. I've tried using memory DCs as described in the MSDN docs, but these appear to be restricted to sizes compatible with the current display driver. I'm currently using a bitmap print driver ...

How to get the RGB values for a pixel on an image on the iphone

I am writing an iPhone application and need to essentially implement something equivalent to the 'eyedropper' tool in photoshop, where you can touch a point on the image and capture the RGB values for the pixel in question to determine and match its color. Getting the UIImage is the easy part, but is there a way to convert the UIImage d...

Is BitmapSource the only type can be used in Image Source?

We can use Bitmapsource object as the content of a Image control, However if I only have Bitmap object, can I use it directly, if I convert Bitmap to Bitmapsouce using the following method: Bitmap bitmap = imageObjToBeConvert; IntPtr HBitmap = bitmap.GetHbitmap(); result = Imaging.CreateBitmapSourceFromHBitmap ...

I need my scaled image to be aliased in C#

This might be an odd question, but when I scale my image in C# I need it to be pixelated and not anti-aliased. Just like in MSpaint when you scale. I hope images anti-alias by default in C#, or else I changed something I didn't want to. I've tried playing around with the Graphics.InterpolationMode but no luck there. I'm using a Bitmap ...

GZipStream And DeflateStream will not decompress all bytes

I was in need of a way to compress images in .net so i looked into using the .net GZipStream class (or DeflateStream). However i found that decompression was not always successful, sometimes the images would decompress fine and other times i would get a GDI+ error that something is corrupted. After investigating the issue i found that t...

Convert Bitmap to Polygon - (Reverse-Rasterizing)

Given a bitmap image with some blots of solid color on it, what algorithm would you employ to construct polygons in the same shape as the blots? This can be done in multiple steps: a high-resolution polygon could be later cut down by a best fit algorithm. Bonus points if you can tell me how to cut the resulting polygons into convex com...

Image DPI Explained

Attempting to write a definition of DPI has lead me to: DPI (dots), PPI (points), LPI (lines) all refer to the same concept hereafter referred to as DPI. DPI is a device dependent measurement. It says, "This is the resolution of this device." Vector based files are not tied to any one DPI (they expand and contract to conform to a cer...

Compact Framework - any implementation of the Image.FromStream (Stream, Boolean, Boolean) ?

In a .NET CF application I wrote, one of the features is to acquire frames from remote cameras. Frames are acquired as single jpeg images and displayed on the screen when available. It was a good enough solution, but I don't like the fact that the time needed to convert the stream into an Image object, with the Bitmap() constructor, is ...

OutOfMemoryException When Creating a Large Bitmap in CF.NET

My compact framework application creates a smooth-scrolling list by rendering all the items to a large bitmap surface, then copying that bitmap to an offset position on the screen so that only the appropriate items show. Older versions only rendered the items that should appear on screen at the time, but this approach was too slow for a...

How to use GetHBITMAP method?

I have a gdi+ bitmap, and I want to convert bitmap into HBitmap. I write the following code. HBITMAP temp; Color color; img->GetHBITMAP(color, &temp); But It do not work, How can I get a HBitmap? ...

Draw graphs in VBscript

I have a HTML application, partially HTML, partially VBscript, disguised as a form. What it does is it opens a few local files, runs a DOS box containing GAWK and presents a text file as its result. I wish to expand upon it by letting it create a bitmap image with the results in a stacked bar graph, for instance as a .BMP file. But I'm s...

How to Create a Gdiplus::Bitmap from an HBITMAP, retaining the alpha channel information?

When I create a new Gdiplus::Bitmap using the Bitmap::FromHBITMAP function, the resulting Bitmap is opaque - none of the partial transparency from the original HBITMAP is preserved. Is there a way to create a Gdiplus::Bitmap from an HBITMAP which brings across the alpha channel data? ...

accessing bitmap resources in a C++ DLL from VB6

I have a C++ DLL including bitmap resources created by Visual Studio. Though I can load the DLL in VB6 using LoadLibrary, I cannot load the image resources either by using LoadImage or by using LoadBitmap. When I try to get the error using GetLastError(), it doesnot return any errors. I have tried using LoadImage and LoadBitmap in anot...

copy hdc contents to bitmap

How could you copy the contents of an HDC to a bitmap? ...

send bitmap with winsock

How could you send a bitmap over winsock without saving it to a file then sending that? It would also be helpful if you knew how to convert the data after being recieved back into a bitmap. ...

convert bitmap to byte array

How can I convert a bitmap to a byte array in c++ WITHOUT the .net framework? ...

Strange problem about conversion between GDI+ to GDI: Bitmap and HBitmap

I want to convert gdi+ Bitmap into gdi object HBitmap. I am using the following method: Bitmap* img = new Bitmap(XXX); // lots of codes... HBITMAP temp; Color color; img->GetHBITMAP(color, &temp); the img object is drawing on a dialog. when this part of method is called, strange thing happens! the img displaying in ...

"Parameter is not valid." when using saving bitmap

Hi Im trying to save a bitmap jpg format with a specified encoding quality. However im getting an exception ("Parameter is not valid.") when calling the save method. If i leave out the two last parameters in the bmp.save it works fine. EncoderParameters eps = new EncoderParameters(1); eps.Param[0] = new EncoderParameter...

Is it possible to use .png images for WiX bitmaps

I am using 2 500K bitmaps in to display images on my WiX dialogs. They dramatically increase the size of the installation package, and what is worse - it looks there's no way to package them as a part of a .cab file since they're <binary>-es in the WiX terms. So, I thught, is there any way to use other file formats for bitmaps or WiX i...