gdi+

PictureBox.Refresh() is slow when drawing in a PictureBox

I have a Windows Form Application in Visual Studio 2008 - PictureBox.Refesh() method causes a delay when drawing on a PictureBox. Is there any method that gives the same result without delay? ...

Using pattern Adapter for Image Viewer

Hi! I do the Image Viewer. I want to use GDI+ for showing a picture in a window. And the library boost::gil for rotating, converting, resizng an image. But GDI+ contains Image class and boost::gil contains other class Image. How can I use the pattern Adapter for my task? Or what pattern should I use? Thanks! ...

Gdiplus in C++ managed or unmanaged?

is this file with namespace Gdiplus in c++ managed or unmanaged code? ...

error C2248: 'Gdiplus::Bitmap::Bitmap' : cannot access private member declared in class 'Gdiplus::Bitmap'

i am getting this error and i dont know why or understand the reason: vector<double> fourier_descriptor(Gdiplus::Bitmap myBitmap) { vector<double> res; Contour c; vector<Pixel> frame;// = c.GetContour(p); frame = c.GetContour(myBitmap); return res; } the error is in this line frame = c.GetContour(myBitmap); ...

Is the .NET ImageAnimator available for C++ as well?

On codeproject there is an example of extending the GDI+ Image class to support animated gif under C++ However, under .Net there is ImageAnimator. While looking at ImageAnimator I noticed that they show support under 4 languages including C++. Does that mean ImageAnimator is actually available under C++ as well? http://msdn.microsoft...

.Net Inconsistent Font rendering

I am creating an .Net 2.0 SP2 windows Forms Application. The form fonts looks fine in my machine, when i tried in another machine, it looks bigger. (This is not because of resolution difference, fonts are bigger relatively to other icons etc.) I tried to debug the problem and found following code returns different sizes on different mac...

Can GDI+ EncoderParameter rotation only be applied to original image?

I'm performing rotation while resizing a JPEG image using GDI+. If I use Image.RotateFlip(RotateFlipType) when saving a JPEG, it works great. When I pass in any of the Encoder.Transformation parameters, I get a "Parameter is not valid." ArgumentException. I've read that using the Encoder.Transformation parameters during the save proces...

GDI error using a GridViewImageColumn in a Telerik RadGridView with an animated gif

I have a Telerik.WinControls.UI.RadGridView that has a GridViewImageColumn. I use this column to load graphic data from SQL. When that graphic happens to be an animated gif, I get a GDI error, a giant red X on my grid and then it ultimately locks up and I have to close the app. Knowing very little about GDI, I'm unable to determine why ...

AntiAlias failed when draw string with certain angle in GDI+

I am using the following code to draw Strings. In GDI+ Graphics tempFontGr(XXX); Matrix* myPathMatrix = NULL; myPathMatrix->Rotate(GetDCAngle(), MatrixOrderPrepend); cantempFontGr.SetTransform(myPathMatrix); tempFontGr.SetInterpolationMode(InterpolationModeHighQuality); tempFontGr.SetSmoothingMode(SmoothingModeAntiAlias); tempFontGr.Dr...

Visual Studio & GDI++

Hi. I tried to find a similar question here, but found something different. I prefer to use display fonts smoothing in Windows, but I don't like the way how Windows XP smoothes the display font edges. Currently I use GDI++ that smoothes the display fonts making them look very similar to text rendered in Safari browser for Windows (as fa...

Overlapping System.Drawing.Graphics objects

I have a WinForms control on which I want to display two things: An underlying image painstakingly loaded bit-by-bit from an external input device; and A series of DrawLine calls that create a visual pattern over that image. Thing #1, for our purposes, doesn't change, and I'd rather not have to redraw it. Thing #2 has to be redrawn ...

Need advise - How to write a drawing program

I would like to write a program that enable user to draw geometric shapes like circles, triangles, rectangles and so on. I would like also to be able to drag and drop or resize/move a shape that was previously drawn. I thought to draw the shapes inside a Panel. Does it seems reasonable ? After I draw a circle, it becomes a part of a B...

convert png to gif with gdi+ (C#)

Hi, i have a png file which must be converted to a gif file. There is a transparent part in it, and when i save it the transparent part is black in stead of transparent. here's my code: FileStream imgStream = new FileStream(outputFile, FileMode.Create, FileAccess.Write); Image.FromFile(imageInput).Save(imgStream, ImageFormat.Gif); h...

Display hundreds images dynamically

I have to create a form capable of displaying a cinema-hall (don't know the exact word) schema. Essentially I have to display a large number (given by another source) of independent chair-like images which can change color (status) on click. I surf the web searching for a solution but I really don't have a clue how to manage this. Can s...

How do I draw an image reflection in WinForms?

I want do draw a reflection in C# (WinForms) of an image, so I need to be able to flip the image horizontally. I know I can do this with image.RotateFlip, but the problem with this approach is that I have to flip the image twice so I can draw it again the right side up on the next paint. Doing this twice per paint per image seems to be...

GDI+: Cannot load "Vista" icon (OutOfMemory)

Trying to load an icon with GDI+ using GdipLoadImageFromFile: Image image; String filename = "C:\Archive\-=Images=-\Microsoft\Vista\shell32\Icon_129.ico"; Status result = GdipLoadImageFromFile(filename, out image); returns the status OutOfMemory (3). You can also use the object wrapper form: Image image = new Image(filename, false)...

How to solve grayish frame issue when Scaling a bitmap using GDI+

Hi, I'm trying to scale down a Bitmap using GDI+ by doing the following: Bitmap newImage = new Bitmap(NewWidth, NewHeight, Im.PixelFormat); Graphics g = Graphics.FromImage(newImage); g.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMo...

Image resizing with GDI+

I'm really trying to nail out a little more performance out of this tidbit of code. It's not a heavly used bit of code but is used every time a new image is uploaded, and 4 times for each image (100px, 200px, 500px, 700px). So when there are any more than 2 or 3 images processing, it gets a little busy on the server. Also I'm trying to f...

CF.NET Smooth-Scrolling Panel -- bitblt is coming up blank

I'm trying to write a panel in CF.NET that allows me to scroll the contents inside without flickering. I thought I'd try having a WrapperPanel class that contains another panel with the actual contents. Then I'd bitblt the contents of the interior panel to the wrapper based on the scrolling position. But the bitblt isn't working for m...

System.Drawing.Image.Save throws ExternalException: A generic error occurred in GDI

I have function which takes a bitmap, copies part of it and saves it as 8bpp tiff. Filename of the result image is unique and file doesn't exist, program has permission to write to the target folder. void CropImage(Bitmap map) { Bitmap croped = new Bitmap(200, 50); using (Graphics g = Graphics.FromImage(croped)) { ...