I need to take an uploaded image, resize it, and save it to the database. Simple enough, except I don't have access to save any temp files to the server. I'm taking the image, resizing it as a Bitmap, and need to save it to a database field as the original image type (JPG for example). How can I get the FileBytes() like this, so I can...
I have written some c++ code to capture a window to a .bmp file.
BITMAPFILEHEADER get_bitmap_file_header(int width, int height)
{
BITMAPFILEHEADER hdr;
memset(&hdr, 0, sizeof(BITMAPFILEHEADER));
hdr.bfType = ((WORD) ('M' << 8) | 'B'); // is always "BM"
hdr.bfSize = 0;//sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + (width *...
The Vb.Net application creates a bitmap from scratch and either converts to a tiff or sends it to a printer. In both cases, the quality of the image (in this case the font) is not good at all. The sample code listed below creates the graphics object that I use to write to the image.
Dim gr2 As Graphics = Graphics.FromImage(New Bitmap(8...
I have a Delphi 6 Pro application that processes incoming jpeg frames from a streaming video server. The code works but I recently noticed that it generates a huge number of soft page faults over time. After doing some investigation, the page faults appear to be coming from one particular graphics operation. Note, the uncompressed bit...
Hello,
I have a method that I call and it returns bitmap data from a capture device.
It returns a pointer to the buffer data as an IntPtr and the buffer length as an int.
I know in advance that this bitmap is a 24bpp and its width and height.
The problem is that the buffer contains the bitmap data upside down and I need this data to b...
When using the TBitmap wrapper for a GDI bitmap from the unit Graphics I noticed it will always clear out the bitmap (using a PatBlt call) when setting up a bitmap with SetSize( w, h ). When I copy in the bits later on (see routine below) it seems ScanLine is the fastest possibility and not SetDIBits.
function ToBitmap: TBitmap;
var
...
Hello,
I'm trying to write a method to reduce the size of any image 50% each time is called but I've found a problem. Sometimes, I end up with a bigger filesize while the image is really just half of what it was. I'm taking care of DPI and PixelFormat. What else am I missing?
Thank you for your time.
public Bitmap ResizeBitmap(Bitmap ...
What is the best way to set the RGB components of every pixel in a System.Drawing.Bitmap to a single, solid color? If possible, I'd like to avoid manually looping through each pixel to do this.
Note: I want to keep the same alpha component from the original bitmap. I only want to change the RGB values.
I looked into using a ColorMatrix...
Currently I have a third party control that generates a Metafile. I can save the .wmf file to disk with out issue. The problem is how do I render the Metafile as a Tiff file.
Currently I have the following code to get my metafile and save it.
Dim mf As Metafile = page.GetImage(TXTextControl.Page.PageContent.All)
...
Is there a way I can build a bitmap strictly from RGB values for each pixel? I'm trying to build a bitmap from a string of characters.
...
My VB.NET program currently takes a 4BPP TIFF as an Bitmap, converts it to a Graphic, adds some text strings and then saves it out again as a TIFF file. The output Bitmap.Save() TIFF file by default seems to be 24BPP (regardless of the input) and is a lot larger than the original TIFF.
Is it possible to keep the same 4BPP palette encodi...
I want to draw a bitmap on a canvas with bigger size than it is. I can use canvas.drawBitmap(bitmap, null, destRect, null); but that gives a poor quality, as the result is pixelated, if the source image is sightly smaller than the destination rectangle.
How can i draw my bitmap using bilinear or bicubic resampling?
Any help would be a...
The images only loads into the last MC, how to make it load into each MC?
private function imageHandler():void {
imageBox=new MovieClip();
imageBox.graphics.lineStyle(5, 0xFFFFFF);
imageBox.graphics.beginFill(0xFF0000);
imageBox.graphics.drawRect(0,0,150,225);
imageBox.graphics.endFill();
allImage.addChild(imageB...
I have a class Building. It contains a _bitmap object, referenced to a drawable.
I can draw it on an external View, where its canvas calls myBuilding.getBitmap().
Now I want to draw some windows on the building, but I need them to be "tied" to the building, so that translating the x and y of myBuilding, the windows move together.
Is th...
I am using bitmapData and bitmap classes to render a mouse cursor on the display screen. The bitmapData consists of an area whose colors should be inverted according to the background color. This is a very basic thing which could be observed with text cursor(the vertical line with two small horizontals on top and bottom), when moved over...
I'm writing an application which reads and displays images as ImageIcons (within a JLabel), the application needs to be able to support jpegs and bitmaps.
For jpegs I find that passing the filename directly to the ImageIcon constructor works fine (even for displaying two large jpegs), however if I use ImageIO.read to get the image and ...
//I create a bitmap to hold a 1 bit per pixel image:
format = PixelFormat.Format1bppIndexed;
bitmap = new Bitmap(width, height, format);
//Then I fill the bitmap programatically.
...
//I check pixels left and right using bitmap.GetPixel(x,y)...
//Then I mirror the image
bitmap.RotateFlip(RotateFlipType.RotateNoneFlipX);
//When I check...
I'm wondering if there's a super-efficient way of confirming that an Image object references an entirely black image, so every pixel within the bitmap is ARGB(255, 0, 0, 0).
What would you recommend? Most of these bitmaps will be 1024 x 6000 pixels (although it's not safe to assume they'll always be that size).
I need this because we'r...
Hi, in actionscript 3, what's the fastest way to dump your data (not from a file) into a bitmap for display?
I have it working with setPixels and colored rects but that's way too slow/inefficient.
Is there a way to load in the raw bytes or hijack the loader class to put in custom loader data?
What would be the best/fastest--should I s...
My program is working with fax documents stored as separate bitmaps
I wonder if there is a way to detect automatically page orientation (vertical or horizontal) to show image preview for user in right order (meant rotate if neccesary)
Any advices much appreciated!
EDIT: Clarification:
When Faxmachine receives multi-page document it sav...