Hey,
I'm working a lot with Visual Studio 2008, .NET C# 2.0-3.5 and Windows Forms and I have noticed, like many before me, that GDI+ is extremely slow in drawing Controls. Note that I do not deal with images (JPG, GIF etc) very much. Images are only as icons in certain places. This is actually Controls/Forms/etc that are slow to draw.
...
Actually I am running a wesite www.webmaggu.com which is mainly a directory of variou interesting links and websites which are submitted by users. I want to generate thumbnails beside the links. So tried webnapr, picoshot and many others but they don't give free thumbnails for longer days. so I want to generate my own thumbnail generator...
I'm writing a simple automated test application for Win32. It runs as a separate process and accesses the target application via the Windows API. I can read window hierarchies, find labels and textboxes, and click buttons by sending/posting messages etc. All fine.
Unfortunately many controls in the target application are composed of not...
Hello,
I know how to draw straight lines in C#, but I would like to draw a horizontal line, with two colors. Light blue on the top, and dark blue on the bottom. Also, how would I sort of... Append to that line? For example, every few seconds, that line will become bigger... like a ProgressBar. (btw, I'm not creating a ProgressBar, just ...
I can compute horizontal and vertical points, but I cant figure out how to compute distance using diagonal points. Can someone help me with this.
here's the code for my horizontal and vertical measuring:
private float ComputeDistance(float point1, float point2)
{
float sol1 = point1 - point2;
float sol2 = (float)Math.A...
I have two rectangles InnerRectangle and OuterRectangle. I want to verify if four corners of InnerRectangle i.e, Lett, Top, Right, Bottom are completely inside of
OuterRectangle. If those are outside I want change the ones that are outside. If I change Left/Top/Right/Bottom, how much should I change the width or height?
Please let me k...
I want to increase the size of my rectangle by 10 pixels. The following code seems not working. Assume sampleRect is my rectangle. Please let me know.
Rectangle temp = new Rectangle(
sampleRect.X - 10,
sampleRect.Y - 10,
sampleRect.Width + 2*10,
sampleRect.Height + 2*10);
...
There's a registry key where I can check (& set) the currently set GDI object quota for processes. However, if a user changes that registry key, the value remains the old value until a reboot occurs. In my program, I need to know if there's a way to determine, programatically, how many more GDI objects I can create. Is there an API for g...
I have a tab-based application for windows, which I am developing by myself.
I would like to add a subtle gradient to the background of my tab control. How would I go around doing this? What is the best method for me to use?
I think that implementing a custom control that takes up the space of the tab control would work, but how would ...
Using GetPixel, Is that right that you retrieve the pixel information that HDC temporarily store after you draw on each WM_PAINT call?
...
I'm drawing text on window at WM_PAINT message, is there any way i can refresh that window region before drawing a new line of text so the old text at the same location would get erased?
...
does anyone know any good GDI drawing application with source code available which is similar to mspaint?
...
Hi All,
Is anybody aware of a way to enable OpenGL stereo while using a layered window in Windows 7?
...
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 ...
I was using GetDIBits to get bitmap data from a screen compatible device context into a DIB of a certain format. I was under the impression that the DC was necessary only for synthesizing a color table when the source bitmap is 8 bits-per-pixel or less. Since my source bitmap was a full 32-bit color image and this was a one-off program...
I want to copy a image on to another image where the target image contains the source in the center and rest background should be white.
Here is my code
hBitmap = (HBITMAP)LoadImage(NULL, "logo.bmp", IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE | /*LR_CREATEDIBSECTION | */ LR_DEFAULTSIZE);
GetObject( hBitmap, sizeof(BITMAP), &bm...
Hello,
I've seen some neat splash screens like VS 2010, Adobe products, etc. I know in VS.NET you can set a transparency color, etc. but I have never been able to make one look nice that didn't have some type of jagged edges or color issues on the edges. For example, I could create a black circle with magenta as the transparent color ...
CreatePen GDI function does not work on Windows 7 when pen width is 3 or 4 (LineTo draws nothing). It works for 0 - 2 width. In all cases PS_SOLID pen style was used.
...
I'm trying to draw a polygon with more than one holes. I tried the following code and it does not work correctly. Please advise.
PointF[] mypoly = new PointF[6 + 5 + 5];
mypoly[0] = new PointF(0, 0);
mypoly[1] = new PointF(100, 0);
mypoly[2] = new PointF(100, 100);
mypoly[3] = new PointF(0, 100);
mypoly[4] = new...
HI,
I am using loadImage to load an 24bit bmp file and then try to get the bmp info
hBitmap = (HBITMAP)LoadImage(NULL, "logo.bmp", IMAGE_BITMAP, 0, 0,
LR_LOADFROMFILE | LR_DEFAULTSIZE)
GetObject( hBitmap, sizeof(BITMAP), &bm );
When I do the same operation with windows color display setting 32 hi color than i got ...