How to Convert a Bitmap-like struct into an HDC?
I am now writting image processing program in c++, gdi.
If I got a HDC.
I can draw whatever I like on the HDC in gdi by the following code.
// HDC is handy.
HDC dc;
dc.DrawXXX // I can draw using gdi method.
Graphics gr(dc); // now I can also draw on the dc using gdi+ method.
My...
I have a WPF BitmapImage which I loaded from a .JPG file, as follows:
this.m_image1.Source = new BitmapImage(new Uri(path));
I want to query as to what the colour is at specific points. For example, what is the RGB value at pixel (65,32)?
How do I go about this? I was taking this approach:
ImageSource ims = m_image1.Source;
...
I am using layered windows and drawing a rounded rectangle on the screen. However, I'd like to smooth out the jagged edges. I think that I'll need alpha blending for this. Is there a way I can do this with GDI?
...
For a home project I need to plot (x,y) coordinates onto a 400x400 black and white-bitmap.
What perl module would you recoment and what image format (GIF?, PNG? other?) would be easiest to handle on OS X, Windows, Linux?
EDIT My solution, based on GD, as recomended by Brian Agnew
use strict;
use warnings;
use GD;
my $BitMap = GD:...
Hi all
I am building a website for a club that is part of a mother organisation. I am downloading (leeching ;) ) the images that where put on profile pages of the mother organisation to show on my own page. But their website has a nice white background, and my website has a nice gray gradient on the background. This does not match nicel...
I am writing program in c++ gdi gdi+.
Drawing large image on gdi+ bitmap is slow is using gdi+ api.
So I used the following way to draw:
Bitmap img(xxx);
Graphics gr(&img);
HDC dc = gr.GetHDC();
::StretchDIBits(
dc,
rec.left, rec.top,
(rec.right - rec.left), (rec.bottom - rec.top),
m_recRegin.left , m_recRegin.top,
...
I have a Bitmap object that I need to sometimes flip horizontally, sometimes vertically, sometimes both. The full framework has the Image.RotateFlip() method which is exactly what I need. Unfortunately like most useful features on the full framework, this method does not exist on the compact framework. Is there a simple way to do this...
I am making an imaging application. I need a 16000 x 16000 pixel image. This is not impossible because in PhotoShop I can create this image for print. (56 x 56 inches, in 300dpi)
I am using this code:
Image WorkImage = new Bitmap(16000, 16000);
This generates an "Invalid Parameter" exception, but not when I do 9000 x 9000 Pixels.
MS...
Hello.
I am learning ActionScript 3.0 and I am seeing this paradigm often:
package util
{
import flash.display.Sprite;
import flash.display.Bitmap;
import flash.display.Loader;
import flash.display.LoaderInfo;
import flash.net.URLRequest;
import flash.events.Event;
public class BitmapLoader extends Sprite
...
I'm using my digital camera as a quick and dirty scanner. Resolution is actually around 300dpi, which is quite reasonable. But my camera produces a color image, which I want reduced to a bitmap. I do not want to dither the image; I'm looking for what I would get if I put the document through a black-and-white scanner. Converting a JP...
In BlackBerry, is it better to use the Bitmap class or EncodedImage in terms of memory usage and performance? Are there any specific tips on using these classes?
...
I know how to implement them, but what I don't know is whether to apply the transformation pixel by pixel or is there another way to affect the whole image, using a single call, etc?
AFAIK Get.Set Pixel is very slow. I am not sure if they did it this way.
So if it's the grayscale/desaturate filter as a simple case, how would one write ...
In Delphi 7, I have to deal with pretty large 24bpp bitmaps (several 100 MB). Since I want to use the Graphcis32 library for further processing, they have to be converted to 32bpp (TBitmap32). The LoadFromFile method of TBitmap32, however, creates a temporary conventional TBitmap to load the original 24bpp bitmap which is then assigned t...
I made this from an example i saw, it never threw any error, but the image is displayed as grey.
Is there a better way to do this?
private unsafe void menuItem7_Click(object sender, EventArgs e)
{
var settings = Utility.GatherLocalSettings();
openFileDialog1.InitialDirectory = settings.SavePath;
openFileDia...
After reading this blog, I want to try writing a similar program myself.
One of the subtasks is to have a source set of polygons, and use these polygons to generate the bitmap that is going to be compared with the target image.
In .NET 2005 the obvious method is to use GDI+. Simply create a bitmap, get a Graphics object that interfaces...
I'm trying to load a bitmap in Android which I want to tile. I'm currently using the following in my view to display a bitmap:
canvas.drawBitmap(bitmap, srcRect, destRect, null)
I essentially want to use this bitmap as a background image in my app and would like to repeat the bitmap in both the X and Y directions.
I've seen the TileM...
I have loaded a SWF which is created in Flash CS9 (AS3). I'm having problem passing Bitmap (or BitmapData) from the flex app to the loaded SWF.
Invoking of other functions in the loaded from Flex works, but when I try to pass a Bitmap to the loaded SWF, nothing happens. Here's a sample code:
FLEX:
try{
var bm:Bitmap = (someEvent....
Consider this code for loading, modifying and saving a Bitmap image:
using (Bitmap bmp = new Bitmap("C:\\test.jpg"))
{
bmp.RotateFlip(RotateFlipType.Rotate180FlipNone);
bmp.Save("C:\\test.jpg");
}
it runs without any exception.
But consider this one:
using (Bitmap bmp = new Bitmap("C:\\test.jpg"))
...
What is the best way to read a PPM (P6) image file in C# and save it as a Bitmap?
...