bitmap

Help with bitmap lock - Format8bppIndexed

I can't get this code to work... can anybody tell me what's wrong? cropCanvas1.Image is a Bitmap object with PixelFormat = Format8bppIndexed The resulting Bitmap is black thanks! //cropCanvas1.Image.PixelFormat is Format8bppIndexed Bitmap bmp = new Bitmap(cropCanvas1.CropArea.Width, cropCanvas1.CropArea.Height, cropCa...

Bitmap.Save, Huge Memory Leak

I have an application where I am taking a bitmap and compressing it using a GZipStream and sending it over a socket, all in memory. I have tracked down the dirty scumbag memory leak to the following line: frame.Save(inStream, jpegCodec, parameters); Browsing around the good ol' information superhighway I have found numerous topics abo...

c# external Exception in GDI+

I want to run this piece of code Bitmap grayImage = (Bitmap)img.Clone(); for (int x = 0; x < arr.GetLength(0); x++) { for (int y = 0; y < arr.GetLength(1); y++) { int col = arr[x, y]; Color grau = Color.FromArgb(col, col, col); grayImage.Set...

How to make a transparent Image in CF 2.0 without third party libraries?

Hello, is there a way, to make a picture transparent in CF2.0? I have to lay a small Image over a textbox, but it has to be transparent so the User can see the text anyway. Do you have an Idea? Thank you very much twickl Edit: Thanks for your answers, I will check those links out! To complete my Post, here is what I´m trying to do:...

Combine two images with one being transparent

I have two bitmap images. One contains a picture taken with a usb camera. The other will contain a shape, like a rectagle, but it can also be a trapezoid, or lets say, a random shape with only one color in it. The rest of the image is white right now. The two images aren't of the same size but scaling algorithms aren't the most difficul...

Sharpen on a Bitmap using C#

I want to put a sharpen filter on an image. I have found a web with short tutorial. I tried to do it in C# so here is my code. Anyway, I tried to find out why it is not working. I do not know if I am doing something wrong, if yes, please advise me what to do to make it work as it should be. Thanks public static Bitmap sharpen(Bi...

Convert GD-Sharp stream to Bitmap

im currently trying out GD-Sharp and wanted to convert the graphic into bitmap without saving it to image file. GD-Sharp method to save to stream is bool GB.Save(Stream outStream); for saving using stream is using(FileStream fs = File.OpenWrite(@"stream1.jpg")) { image.Save((System.IO.Stream)fs); fs.Close(); } since bitmap ...

Is there a way to convert a VML document to a bitmap image ?

I've been looking for a long time for a way to have a bitmap from a VML document. In fact, I working on a few libs that use the tag, so I have no problem for anything except for IE (of course) because I'm using ExCanvas in IE, but I'd like to have a bitmap from the generated "canvas" (which is in fact VML). I've been looking for a few ...

source to image

how to show a image with AS3 from source like: "GIF89a,.,...... ..sR....8.d.4..p...%...h..'$W..." etc... thanks in advance Leo ...

Android - Fill bitmap with colour

Hey all! I'm working with Android and I really need a fast way to get a bitmap of a predetermined size to be filled with a predetermined colour. The following code is not working for me however; Bitmap input is a mutable bitmap int old = input.getPixel(0, 0); Canvas c = new Canvas(input); Rect rect = c.getClipBounds(); // The dime...

How can I get the PixelFormat of a Bitmap using .NET CF 2.0?

I'm trying to speed up performance of some image scaling & coloring routines in a mobile app based on .Net compact framework 2.0. I've discovered the Bitmap.LockBits method, but how can I get a Bitmap's PixelFormat when the PixelFormat property is not supported in the compact framework? ...

Can .NET code compiled with the unsafe tag run in Mono?

I have some code that does Bitmap manipulation using the LockBits method and accessing the bitmap data directly using a pointer. This code has to be wrapped in an unsafe block, of course, and I was wondering if this means that the code would not work in Mono. I'm assuming the Bitmap class is available in Mono, but maybe that's another ...

Image vs Bitmap class

Afternoon all, As this is my first post, let me introduce myself, I am Kadrin. I'm a developer at a large corporation in the central United States and have been out of college for about 1 year. Anyway, I've been reading up on my C# alot lately (my team is slowly moving over to C#) and am having troulbe understanding the differences b...

Load Jpg/Gif/Bitmap and convert to Bitmap

Hi, I have to load an image from an XML file. There is no information in the XML file about whether the image is JPG/GIF/BMP. After loading the image, I need to convert it to Bitmap. Does anyone have any clue how to convert images to Bitmap without knowing the actual file format? I'm using Delphi 2007/2009 Thank you. ...

How to paint a bitmap with perspective ?

I need to paint a Windows bitmap with perspective, in example: only using Windows API C functions (no MFC, no DirectX, etc.) ...

Getting the height of an ImageSource in Silverlight

In my Silverlight control, I am loading my background image from a stream: BitmapImage img = new BitmapImage(); img.SetSource(stream); Image background = new Image(); background.Source = img; How can I find out the height of the bitmap image that was loaded from stream? None of the usual suspects (e.g., Property, Dependen...

Shrink the bitmap to required dimension

Hi, I have a bitmap of large dimension (2000 x 2000) i need to shrink that bitmap to a small dimension (150 x 150). i have written a code for it, but its not working. Can anybody help in finding the problem? The problem is the destination bitmap is just blank. I am selecting wrong DC's? I have made sure that both the source and destinat...

Is there a way to access an Image's bitmap data using Javascript?

I am looking for a way to create a hash for an image displayed on an XHTML page using Javascript. ...

XY-Bitmap in an MFC application

I am using a library that has been ported to Windows from Linux. The library is used to read a terrain database and up to this point it has been used for simple queries; elevation, line-of-sight, etc. But it also has the ability to create bitmaps of the underlying terrain file that I'd like to take advantage of... The function I am us...

WPF Blurry Images - Bitmap Class

I am using the following sample at http://blogs.msdn.com/dwayneneed/archive/2007/10/05/blurry-bitmaps.aspx within VB.NET. The code is shown below. I am having a problem when my application loads the CPU is pegging 50-70%. I have determined that the problem is with the Bitmap class. The OnLayoutUpdated() method is calling the Invalida...