I posted a question not to long ago about how my program was essentially leaking memory: see here. I have now tracked it specifically to some code in which I copy the raw bytes of a Bitmap object into a managed array. The relevant code:
public class FastBitmap
{
...
private byte[] rgbValues;
private int height;
private i...
Hi all -
I need to find a way to copy a masked bitmap. I have a bitmap on stage, and a user drawn sprite that acts as a mask. I need to capture/copy the masked area bitmap, maintaining the transparency created by the masking to eventually encode as a png.
I could find no documentation on how to accomplish this using copyPixels(), or an...
I am trying to read a bmp file using fstream.
However it skips the values between 08 and 0E (hex)
for example, for values
42 4d 8a 16 0b 00 00 00 00 00 36
it reads
42 4d 8a 16 00 00 00 00 00 36
skipping 0b like it does not even exist in the document.
What to do?
code:
ifstream in;
in.open("ben.bmp", ios::binary);
unsigned char a='\...
I am trying to write a function to determine whether two equal-size bitmaps are identical or not. The function I have right now simply compares a pixel at a time in each bitmap, returning false at the first non-equal pixel.
While this works, and works well for small bitmaps, in production I'm going to be using this in a tight loop and o...
I have a custom wpf control to do an arbitrary reverse image warp, that use a Viewport3D and custom matrix, and a mesh with an ImageBrush...
I'm trying to render this to a bitmap entirely off screen. I am able to render a bitmap fine (I found to call .Measure() .Arrange(new Rectangle(...)) and .UpdateLayout()) before rendering, but the ...
I'm trying to read in a bitmap starting with its header, but fread is skipping characters for me.
I'm using this typedef in my header:
#include <windows.h> // Used for other
#include <cstdio>
typedef struct tagBITMAPHEADER{
WORD wFileType;
DWORD dwFileSize;
WORD dwReserved;
WORD dwReserved2...
How could I make waving text on a canvas element similar to what is found on this page?
...
I have created a bitmap in memory, and would like to show this in rave report design time. I don't want to create a file then load. Is there a better way?
Thanks and regards,
jai
...
So on my site, a user has the ability to create an avatar. It's created by the user selecting from several images; there is a base "skin" image, and png's that overlap that image that depict hair, eyes, mouth, etc.
I cannot save the user's avatar to the project's files, so the user's avatar data is stored in the database, and the png's...
Hi
Is it possible to get the bitmap data from a component using ActionScript?
I dynamically load an image.
onComplete I create a Flex Image component and add the loaded image to the source
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event):void
{
var image:Image = new Image();
image.x = 0;
im...
Hi, the following code is fairly straight forward - it fills a design surface with randomnly selected pixels - nothing special (ignore the XXXXXXX's in the 2nd method for now).
private void PaintBackground()
{
Random rnd = new Random();
Bitmap b = new Bitmap(this.Width, this.Height);
for (int vertical = 0; vertical < this.H...
Hi,
I am trying to use the GDI GradientFill function to draw on a offscreen bitmap, then BitBlt that to the screen.
But I always get a black bitmap... if I GradientFill directly to the screen it works.
Below is a sample app to see what I mean.
#pragma comment(lib, "msimg32.lib")
#include <windows.h>
const CHAR c_szWndClass[] = "Grad...
I'm working on an application that prints a folder of image files, including JPEG and TIFF. The TIFF images are usually Black and White (1bpp).
After loading the image, I want to determine if the image is Color or B&W or Grayscale so I can send the image to the right printer (color printer or black and white printer).
I'm using the Bi...
Hi -
I have a container with masked bitmap in it. The scale and rotation of this container changes at runtime, and I need to draw the masked bitmap but cannot figure out the appropriate matrix calculations to do so.
My code works correctly to reflect position, scale, offset for centering without rotation. When rotated, the angle is cor...
Hi, I need to do some rudimentary text rendering to a pixel buffer, and I think that having a table indexed by char with the representation of the letters as a binary array would be more than enough... Anybody knows about a free header as such?
Example:
char data[256][8][8];
void init()
{
data['a'] = {
{0,0,1,1,1,0,0,0},
{0,1...
How do I do that in C#? :)
Thx!
...
Hi All,
I'm kindly asking you to help me with this problem:
There's a byte array (data: PByte) containing DIB data AND DIBHeader:
TDibHeader = record
size: Cardinal;
width: Integer;
height: Integer;
planes: Word;
bits: Word;
compression: Cardinal;
image_size: Cardinal;
x_res: Integer;
y_res: Int...
Is there another way to draw an object on a canvas in android?
This code inside draw() doesn't work:
Bitmap bmp = BitmapFactory.decodeResource(getResources(), R.drawable.pushpin);
canvas.drawBitmap(bmp, screenPts.x, screenPts.y-50, null);
Well actually, it's working on my 1st code but when I've transfered this ...
Recently I've found TPngImageList component ( http://cc.embarcadero.com/Item/26127 ) which is very good, but it handles only png images ... I'd like to have some imagelist that allows combining of pngimages with bitmaps, as I'm using lots of bitmaps, and I do not want to spend coming week converting those bitmaps to pngs, yet I want to u...
Basically I receive the Image's URI from the Gallery, then created a Bitmap and want to send to another activity for displaying:
Uri imageUri = intent.getData();
mBitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), imageUri);
Intent intent = new Intent(TakePictureActivity.this, PreviewActivity.class);
intent.putExtra(EXTRA_...