bitmap

How to get the drawn image away from the screen, when i have scrolled down the panel?

The main form has added a panel(from now called "imagePanel") to itself. The panel is automatically stretched by some elements on the top and on the left side. Autoscroll is true, so i can scroll around in the panel. Here is my problem: When i scroll down or sideways on the panel, the image is always THERE. e.g: I have scrolled down t...

How do I draw a filled circle onto a graphics object in a hexadecimal colour?

I need to draw a circle onto a bitmap in a specific colour given in Hex. The "Brushes" class only gives specific colours with names. Bitmap bitmap = new Bitmap(20, 20); Graphics g = Graphics.FromImage(bitmap); g.FillEllipse(Brushes.AliceBlue, 0, 0, 19, 19); //The input parameter is not a Hex //g.FillEllipse(new Brush("#ff00ffff"), 0, 0,...

Save a 32-bit Bitmap as 1-bit .bmp file in C#

What is the easiest way to convert and save a 32-bit Bitmap to a 1-bit (black/white) .bmp file in C#? ...

Getting Bitmap of all the Views in ViewFlipper in Android?

Hi, I need to take the Bitmap of all the Views in ViewFlipper. But it gives me the Bitmap of only the current content on the screen. Is there any way of getting Bitmap of all the Views in the ViewFlipper. Or is there any other way around to get the Bitmap of all the Views. I have four views and need to load them at the same time and ge...

Graphics/Bitmap Limits?

Im having some weird problems with Graphics and Bitmap. I have a Graphics Object that is displayed on a PictureBox and im capturing the MouseMove and MouseClick Events that give X and Y Position of the Mouse on the Image but if the Y Position goes Bigger then 32775 it then goes into Negatives which means everything breaks. And if the Im...

How does Bitmap.Save(Stream, ImageFormat) format the data?

I have a non transparent, colour bitmap with length 2480 and width 3507. Using Bitmap.GetPixel(int x, int y) I am able to get the colour information of each pixel in the bitmap. If I squirt the bitmap into a byte[]: MemoryStream ms = new MemoryStream(); bmp.Save(ms, ImageFormat.Bmp); ms.Position = 0; byte[] bytes = ms.ToArray(); the...

Editing 8bpp indexed Bitmaps

hi, i'm trying to edit the pixels of a 8bpp. Since this PixelFormat is indexed i'm aware that it uses a Color Table to map the pixel values. Even though I can edit the bitmap by converting it to 24bpp, 8bpp editing is much faster (13ms vs 3ms). But, changing each value when accessing the 8bpp bitmap results in some random rgb colors even...

Large black line appears when printing bmp files using the EPL2 print language

This is the 3rd part to this topic. Part 1, Part 2.. I was successfully able to print my monochrome bitmap to my printer, however there is a large black stripe along the right of the image when the item prints. Original file that the code is using (Scanned in)What the printer printed Code to generate binary blob Rectangle rect =...

A device specific alpha bitmap fails after switching resolutions in remote desktop

All my alpha bitmaps, created using CreateCompatibleBitmap(..), start to receive an error code 87 after someone signs in with Remote Desktop. I am assuming that this is because the resolution changed and I am using a device specific bitmap. I am wondering what the best route is to fix this issue without migrating to a device independen...

Android: Is decreasing size of .png files have some effect to resulted Bitmap in memory

I'm writing game with a large amount of .png pictures. All worked fine. Than I added new activity with WebView and got memory shortage. After that I made some experiment - replace game .png images with ones that just fully filled with some color. As result memory shortage had gone. But I suppose that Bitmap internally hold each pixel se...

Is there a way to capture a bitmap from a WPF window using native C++?

Imagine a document window in a MDI application which contains a child WPF window, say a sidebar for example. How can one get a bitmap containing both the WPF pixels AND the GDI (non-wpf) pixels? I've discovered that when making my thumbnail preview for the Win7 taskbar app icon hover, I get black in the parts of the preview where the WP...

Bitmap files added in .rc not listed in resource.h

I added a large number of bitmap files to my MFC project in resource view (Visual Studio). However, the resource.h file does not list any of these files. I would want them to be listed with exactly the same name as they are added in .rc bitmap list (say the name is xxx) I want it listed as #define IDB_xxx If I try to click on the bitmap...

Windows Forms' PictureBox with zooming and panning

My application needs control displaying bitmaps (jpg) but also zooming and panning them (so if you press mouse button you can 'move' zoomed picture inside frame) What I did was placing panel at the Form, then pictureBox inside panel (anchored Top,Left). So if I need zoom it I'm just executing below code from Zoom buttons events: pr...

Large Image in .net

I want to create large image by C#. (i have some photos with large size (4800 * 4800). i want to merge these photos.) I use Bitmap but don't support. (Error : Invalid Parameter) ...

Bitmap as button?

How to set a bitmap as a button so that i can apply button mode and mouse-event stuff on it, without adding the bitmap to a Movie Clip? var bmpFull=new Bitmap(event.currentTarget.content.bitmapData); bmpFull.smoothing=true; bmpFull.name="photo"; bmpFull.alpha=0; //fullMC.buttonMode=true; fullMC.a...

How to blit() in android?

I'm used to handle graphics with old-school libraries (allegro, GD, pygame), where if I want to copy a part of a bitmap into another... I just use blit. I'm trying to figure out how to do that in android, and I got very confused. So... we have these Canvas that are write-only, and Bitmaps that are read-only? It seems too stupid to be re...

How to set Source of s:BitmapFill dinamicaly? (FLASH BUILDER, CODE INSIDE)

In Flash Builder (flex 4) I try to use next code to set selected by user (from file system) Image as a repeated background. It worked with mx:Image but I want to use cool repited capabiletis of s:BitmapFill. BTW: Technic I use also does not work with S:BitmapImage. Also FP does not return any errors. What Shall I do with my code to mak...

Masking a Drawable/Bitmap on Android

I'm currently looking for a way to use a black and white bitmap to mask the alpha channel of another bitmap or Drawable on Android. I'm curious as to what the best way to do this is. I certainly have a couple of ideas for how to do this, but they are not optimal. I need to be able to apply a new mask to the image every so often (the b...

Super wide, but not so tall, bitmap?

Is there any way to create a more space/resource efficient bitmap? Currently I try to render a file, approx 800px high but around 720000px wide. It crashes my application, presumably because of the share memory-size of the bitmap. Can I do it more efficient, like creating it as an gif directly and not later when I save it? I try to save...

How to get an BITMAP struct from a RenderTargetBitmap in C++/CLI?

I've got a WPF RenderTargetBitmap in C++/CLI and I want to be able to create a BITMAP structure from it to use with BitBlt. I've not worked with BITMAP or RenderTargetBitmap much before, so any thoughts would be great! ...