bitmap

Auto scrolling or shifting a bitmap in .NET

I have a .NET GDI+ bitmap object (or if it makes the problem easier a WPF bitmap object) and what I want to to is shift the whole lot by dx,dy (whole pixels) and I would ideally like to do it using .NET but API calls are ok. It has to be efficient bacause its going to be called 10,000 times say with moderately large bitmaps. I have imp...

Remove a color from a bitmap picture ?

Hi there, I'm trying to remove a color from a picture imported (JPG) in Flash CS4 with AS2. I have a bunch of JPG images loaded at launch that contain a color (flashy green 0,255,0) that I want to remove in order to see through. JPG doesn't support alpha and I don't think flash add an alpha layer to loaded file ? If the loaded image ...

Bitmap Save in .Net is saving the image in an incorrect format??

We have a piece of code which saves a .Net System.Drawing.Bitmap to file. The Save call is specifying the file location as well as the ImageFormat which we are expecting to save the image data as a Jpeg so out code looks like this: public MediaFile IngestImage(System.Drawing.Bitmap imgSrc, string name){ ... // left out because it ...

Get resolution of bitmap from file vb .net

I have a filename that leads to a picture. It is not an embedded resource. My bitmap object always tells me the resolution is 96x96 no matter what, how can I get the actual resolution. Thanks ...

How to NSLog pixel RGB from a UIImage?

I just want to: 1) Copy the pixel data. 2) Iterate and Modify each pixel (just show me how to NSLog the ARGB values as 255) 3) Create a UIImage from the new pixel data I can figure out the the gory details if someone can just tell me how to NSLog the RGBA values of a pixel as 255. How do I modify the following code to do this? Be Speci...

How to increase/decrease an Unsigned Char?

I am trying to modify pixel values (8 bits per channel RGBA) by numerically increasing/decreasing the values by a certain amount. How can I do this in Objective-C or C? The following code generates a "Error: EXC_BAD_ACCESS" everytime. // Try to Increase RED by 50 for(int i = 0; i < myLength; i += 4) { //NSLog prints the values...

C# sound visualisation

I would like to create a sound visualisation system using C# language and .NET Framework. This could look like in Winamp application. Maybe exist free library or some interesting articles which describe how to do it? Example: ...

c#: Getting the image behind a control

I have c# form which have several controls on it, part of the controls are located one on another. I want a function that will take for input a control from the form and will return the image that has to be behind the control. for ex: if the form has backgroundimage and contains a button on it - if I'll run this function I'll got the pa...

c# winforms: Getting the screenshot image that has to be behind a control

I have c# windows form which have several controls on it, part of the controls are located one on another. I want a function that will take for input a control from the form and will return the image that has to be behind the control. for ex: if the form has backgroundimage and contains a button on it - if I'll run this function I'll got...

Allocation memory for display

I am trying to create a graphics library... i need to int NewDisplay(Display **display, DisplayClass dispClass, int xRes, int yRes) { /* create a display: -- allocate memory for indicated class and resolution -- pass back pointer to Display object in display */ return SUCCESS; } How can i allocate memory to class and to t...

GetIconInfo function not working properly

I have written an application which is getting the Icon info of current cursor using GetIconInfo function of user32.dll, It works fine for some time, but after some time it starts providing wrong information in ICONINFO.hbmMask (some negative value), and when on the next line I try to get Bitmap object from Bitmap.HBitmap(bitmask), it th...

VB/C#: Placing disposible objects in global scope: Is this okay?

As an optimization, I decided to put an object I frequently need - an SDL surface with a prerendered image of the entire level (called S_AreaBMP) - at global scope. Now it doesn't have to be created and destroyed in the DrawScreen function every frame. I only need to dispose and change it when a new level or GFX sheet is loaded, which I ...

Compress image in .NET

How can i compress and image file(bmp,jpeg) in C#, I have to display some images as background on my controls, i m using following code to scale my image Bitmap orgBitmap = new Bitmap(_filePath); Bitmap regBitmap = new Bitmap(reqSize.Width, reqSize.Height); using (Graphics gr = Graphics.FromImage(reqBitmap)) { gr.SmoothingMode = S...

How would you perform this bitwise operation?

For a particular application using bitwise masks to store a value, I'd like to perform a certain bitwise filter, but I'm not sure what it's called, or how you'd actually do it in a sensible way. // I'll just refer to the operator as "?" for the sake of example: Input1 ? Input2 = Output 0 ? 0 = 0 0 ? 1 = 0 1 ? 0 ...

How does Doctype do its screenshot manipulation?

Doctype does some pretty neat screenshot manipulation, you know, the paper curl effect with the clip, shadow, etc. What amazing serverside library does this? or can do this? I know of ImageMagick which does all sorts of image manipulation but it doesn't come close to the kind of stuff that Doctype's screenshots are made of. ...

How do I convert a Graphics object to a Bitmap object, inside PrintPage event?

This is the high level problem I'm trying to solve... I have a 3rd party plotting/graphing (IoComp Plot), and I want to embed a high quality (at least 600 dpi) bitmap of the Plot control in reports created by another 3rd party report package (Combit List & Label). This is the approach that seems most promising so far... ---Edit---: ...

Creating new image from cropped image

I'm currently trying to crop an image, and then save the new image. I have the original image, the x and y co-ordinates of where on that image I want the cropping to being, and the width and height of the new cropped image. Here is my code: Bitmap originalBitmap = new Bitmap(filePath); Bitmap newImage = new Bitmap(width, height); Graph...

Accessing raw image data with Snow Leopard

I develop with XCode 3.2 under Snow Leopard, and I want to read a jpg-file from disk into memory and manipulate directly with the raw image bitmap presented as a C char array. How can I achieve this? ...

Computing a UIImage to be saved to the photo album

I basically want to automatically create a tiled image from a bunch of source images, and then save that to the user's photo album. I'm not having any success drawing a bunch of small UIImage's into one big UIImage. What's the best way to accomplish this? Currently I'm using UIGraphicsBeginImageContext() and [UIImage drawAtPoint], etc. A...

Bitmap.SetPixel(x,y, Color) too slow

So currently I'm creating a 1000x1000 bitmap and it's spending about .3 seconds simply calling the Bitmap.SetPixel() function. I'm actually only drawing probably 50% of the pixels so it's more like 500,000 call to setpixel. While that does seem like a lot of calls, OTOH video games are do alot more and push many many more pixels (some ...