bitmap

Issues with GLUtils.texImage2D and Alpha in Textures

Hi all I'm successfully generating my textures using GLUtils.texImage2D, but when I use the textures generated I get problems with my alpha: they are darker than wanted. after having checked several things I finally got the the conclusions that the problem comes from GLUtils.texImage2D(GL10.GL_TEXTURE_2D, level, bmp, 0); I created a s...

Silverlight 4 WriteableBitmap to Bitmap

This is my first Silverlight app and my first go at C#. I have a C# class library that I access from Silverlight using COM. The C# library has a method that takes a Bitmap as an argument, however from what I can see Silverlight only has a WritableBitmap. Is there a way to convert a WritableBitmap to a Bitmap in Silverlight? Some other...

Saving bitmap to SD card with out compressing it in android

Hi friends I am using android inbuilt camera to take picture and then attaching the same picture to email, when i am testing this functionality in 1.6 device, i am able name the picture that to be taken by in built camera, but in 2.1, the picture is having a name i.e given by device, How to give user defined name in 2.1 inbuilt camer...

Is it possible to modify a WPF BitmapSource in memory 'unsafe'ly from another thread

I would like to do some processing of images in a WPF application. However, I would like to modify the pixels of a BitmapSource in memory at runtime. I'm currently managing to do this using 'unsafe' code against an old fashioned System.Drawing.Bitmap and it works a treat (lock a working area, fiddle with the pixels) job done. The approa...

C# Bitmap.Save doesn't save to virtual directory located on other server

When we try to pass to the Save function a path beginning with 2 slashes (eg. "//servername/folder1/..."), the thread gets stuck, we're thrown out of session, and it doesn't save the file ...

Bitmap conversion using GPU

I don't know whether this is the right forum. Anyway here is the question. In one of our application we display medical images and on top of them some algorithm generated bitmap. The real bitmap is a 16bit gray scale bitmap. From this we generate a color bitmap based on a look up table for eg (0-100)->green (100-200)->blue (200>above)...

c# getPixel not sellecting all pixels

Hello! I have a problem with getting the pixels from an image. I load a image, select a pixel from the image and retrieve it's color and then i generate a matrix indexMatrix[bitmap_height][bitmap_width] which contains 1 or 0 depending if the [x,y] color of the bitmap is the same as the color selected. The problem is that the program doe...

How can I generate Bitmap Pictures in Ruby on Rails

What's the best way to generate Pictures, Pixel by Pixel in Ruby on Rails. I have a two-dimenisonal matrix with all the color values for each pixel, which i want to vizualize. Something like this: myBitmap = new Bitmap(:width => Column.all.count, :height => Row.all.count) Colum.all.each do |col| Row.all.each do |row| #Draw the Pixel...

How to genrate a monochrome bit mask for a 32bit bitmap

Under Win32, it is a common technique to generate a monochrome bitmask from a bitmap for transparency use by doing the following: SetBkColor(hdcSource, clrTransparency); VERIFY(BitBlt(hdcMask, 0, 0, bm.bmWidth, bm.bmHeight, hdcSource, 0, 0, SRCCOPY)); This assumes that hdcSource is a memory DC holding the source image, and hdcMask is ...

Android Bitmap syntax

I want to load bitmaps into ImageViews in Android, but I don't want to use the R.drawable syntax because I have a lot of images with a standard naming convention so it's much easier to get the image with some logic. For example, all my images are named: img1.png img2.png img3.png So if a user selects a value, let's say x, I show "img" ...

Android: Huge multi-layer scrolling backgrounds.

Hi there, I'm developing a side-scrolling android game and I've come across one hiccup. The game is rendering graphics on the Canvas object. The game features about 6 scrolling layers, the main ground layer, a collision layer, a foreground layer, and two background layers, which all scroll with variable speed for camera depth. Now, t...

[Quartz2d] Drawing to a bitmap context

I am trying to draw to a bitmap context but coming up empty. I believe I'm creating things properly because I can initialize the context, draw a few things, then create an image from it and draw that image. What I cannot do is, after initialization, trigger further drawing on the context that draws more items on it. I'm not sure if I'm...

How do I create a transparent bitmap with Direct2D?

I am trying to create a PNG bitmap with RGB+A info. I want to draw a rectangle on the bitmap that is semi transparent (In other words, R=255, G=255, B=255 A = 128). I am using managed code so either SlimDX or the codepack API. The most straight forward route appears to be using the codepack api and WIC so I created a WIC bitmap with: ...

Bitmap in C, binary operations

Hi I am about to create a bitmap that holds control of 512 bits, all 512 bits should be 0 to indicate that the bit is free when the program starts. Function occupyDataBlocks(int number) should find free bits put the position of the bit in the array int data_blocks[] and set the occupied bit to 1. Under is some code that does some of t...

How do you save a jpeg with 4-2-2 and high quality in .net?

When I save a jpg file using bitmap.save, it saves as jpeg 4-1-1 when I specify the encoder and quality, but as 4-2-2 when I don't. I would like to save it as 4-2-2 with a higher quality than the default. Is that possible using bitmap.save? Do I lose anything by saving with 4-1-1? Dim bmp As Bitmap Dim ep As New EncoderParameters(1) Dim...

java.lang.OutOfMemoryError: bitmap size exceeds VM budget

Hey guys, So I've got a lazy image loader for my ListView. I also use this tutorial for better memory management and have SoftReference Bitmap images stored in my ArrayList. My ListView works loads 8 images from a DB then once the user scrolls all the way to the bottom it loads another 8 etc etc. There was no issue when there were arou...

LIBTIFF C# color image conversion

Hi, I am using BitMiracle LibTIFF. I cannot find any sample code to take a 32bpp argb colour image and write the bitmap to a tiff using this library. Has anyone else attempted this? Here is my sample code. It produces a file, but it cannot be viewed by any software that I have. EDIT: The code now works, but the colors are wrong! ...

Best way to scale size of camera picture before saving to SD

Hi, The code below is executed as the jpeg picture callback after TakePicture is called. If I save data to disk, it is a 1280x960 jpeg. I've tried to change the picture size but that's not possible as no smaller size is supported. JPEG is the only available picture format. PictureCallback jpegCallback = new PictureCallback() { publ...

How to scale down the image for better quality on Android?

Now I'm using the follow code to scale down the image downloaded from internet at runtime. But the result is not good enough. Bitmap.createScaledBitmap(srcBitmap, dstWidth, dstHeight, true); Any help? Thanks. ...

Convert 2D array of integers to bitmap in Java

I have a 2D array of integers in Java. I want to take this and output a bitmap image file where the red value of each pixel is the corresponding value in the array (blue and green values are 0). Does anyone know how to do this? Thanks. ...