Jalaj

February 28, 2007

Creating Solid and Hatch Brushes

Filed under: Visual Basic, WinAPI — Jalaj @ 4:15 am

The default brush associated with a device context is a hollow brush thus the Rectangle, Ellipse and similar function all tends to draw outlines only and doesn’t fill the shape. The current brush setting can be received in a LOGBRUSH structure (discussed in WinAPI: Using Brushes) using the GetCurrentObject and GetObject functions, already discussed in Modifying Existing Pen in DC
(more…)

February 27, 2007

WinAPI: Using Brushes

Filed under: Visual Basic, WinAPI — Jalaj @ 8:14 am

After Pen Objects we will discuss here Brushes that’s another type of object which is associated with a Device Context. While Pens are used by Windows to draw lines, Brushes are objects that are used to fill the area enclosed within bound regions as ellipse, rectangle, polygons or paths.
(more…)

February 26, 2007

Modifying Existing Pen in DC

Filed under: Visual Basic, WinAPI — Jalaj @ 11:27 am

Want to modify the color or width or the style of the Pen that’s currently associated with the device context? You can’t do it directly as there’s no such function provided by the GDI. However, it’s said, where there’s a will there’s a way.
(more…)

February 25, 2007

WinAPI : The CreatePen Function

Filed under: Visual Basic, WinAPI — Jalaj @ 9:19 am

Getting ahead from where we ended in previous post Pen Object in Device Context, let’s see how to create a pen and associate it with the device context.
(more…)

February 24, 2007

Pen Object in Device Context

Filed under: Visual Basic, WinAPI — Jalaj @ 7:43 am

We saw a lot of functions that draw geometrical shapes. But the problem is that you can’t change the color or width or the style of the pen. The exception to my previous statement is the SetDCPenColor function that can change the pen color associated with the device context, and which we already discussed it in one of previous post WinAPI : GetPixel Function. However, the function is supported only on Windows 200 and later so you cannot use the function if your intent is to develop supporting previous versions too. Is there any way out?
(more…)

February 23, 2007

WinAPI : InvertRect Function

Filed under: Application, Visual Basic, WinAPI — Jalaj @ 12:37 pm

The InvertRect function can be utilized to invert the colors within a given rectangular area of the device context, similar to bitmap operation that you will find with most of the photo editing tools.
(more…)

February 22, 2007

WinAPI : RoundRect Function

Filed under: Visual Basic, WinAPI — Jalaj @ 11:37 am

The Windows API contains Reound Rect function using which we can draw rounded rectangle.
(more…)

Next Page »

Blog at WordPress.com.