Click here to Skip to main content
15,880,608 members
Everything / Multimedia / GDI+

GDI+

GDI+

Great Reads

by Josh Smith
A task-oriented review of an animation library and the application which uses it
by Ajcek84
Open source library for music engraving in desktop, mobile and web applications
by Clayton Rumley
There are those who think I am crazy, and this just might be the proof.
by Volynsky Alex
Part 2 in a series of articles on a two-player mathematical game of strategy

Latest Articles

by spidergeuse
Manipulate WinForms controls to make a simple jigsaw puzzle
by Andy De Filippo
A simple technique to quickly port hatch effects from Gdiplus to SkiaSharp
by Andy De Filippo
Render Rich Text with GDI+ by tapping into the power of API hooking
by Yang Kok Wah
A tool to generate face images and animated gif files for different angles and lighting using only a single face image. Also includes Face Matcher using Microsoft Face API.

All Articles

Sort by Score

GDI+ 

9 May 2012 by Josh Smith
A task-oriented review of an animation library and the application which uses it
15 Jul 2018 by Ajcek84
Open source library for music engraving in desktop, mobile and web applications
27 Apr 2016 by Clayton Rumley
There are those who think I am crazy, and this just might be the proof.
16 Aug 2007 by Volynsky Alex
Part 2 in a series of articles on a two-player mathematical game of strategy
10 Apr 2013 by gggustafson
This article introduces the reader to the steps taken to create a user control that displays a circular indeterminate progress control.
1 Feb 2017 by Mr. xieguigang 谢桂纲
How to build my own 3D graphics engine from ZERO step by step
21 Aug 2019 by Johnny J.
Easily add image cropping to your desktop application
16 Apr 2007 by Matt (D) Wilson
A simple command-line utility that validates XML files, implemented using MSXML via the VOLE COM/Automation driver library
2 Feb 2013 by Ron Beyer
A WinForms line control that works how you would expect one to.
15 Feb 2013 by Dread_Sharp
How to build an easy plugin system with C# which only takes about 30 lines of code!
30 Sep 2009 by Fiwel
Different ways to apply image filters.
29 Jun 2009 by Michael Dunn
Create custom tasks in your app's jump list on Windows 7
8 Oct 2009 by Syed Hasan Hyder
This article focuses on internal supply chain management systems visibility via chart reports, and provides assessment apparatus to manage and monitor activities spawned during business processes, hence paves the way for timely and precise business decisions.
25 Jan 2013 by FatCatProgrammer
StarReport: WPF-less GDI+.NET report component.
12 May 2009 by YLS CS
Cubic Bezier Spline Curves constructed and used in Image Curve adjustment
18 Dec 2012 by Lars [Large] Werner
Windows has built inn support for a lot of keyboard languages, this class makes it possible to extract that info in an easy manner and present it to screen.
12 Dec 2008 by Iain Clarke, Warrior Programmer
A flexible easily overridable combo-box-alike control for choosing from a 2D array of options
6 May 2009 by SprinterDave, Huisheng Chen
Parse and extract APNG frames to each PNG file
30 Mar 2015 by SSDiver2112
Interactive Design Time Control Overlays to make editing custom controls easier.
11 Apr 2016 by Martin Mitáš
Direct2D or GDI+? Perhaps both, with a help of the right library.
5 Jul 2013 by Johnny J.
A sample owner-drawn ComboBox
2 Jun 2015 by Johnny J.
A custom drawn TrackBar that looks like the one in the classic Winamp skin
29 Jun 2016 by The Zakies
we would create Hand_tool to pan through the drawing form, and we would use a custom cursor of open and closed hands
23 Aug 2008 by legcsabi
How to hide UI elements of a FontDialog (e.g., Font Size).
29 Jul 2013 by Ordiales
When no XP support is necessary. Better Icon structure arrises and easy conversion is allowed.
25 Aug 2014 by Anoop Kr Sharma
In this Tip/Trick, I am going to show How to create Simple Paint Application in C#
14 Jun 2021 by gggustafson
This article revises an earlier revision of the Gradient Color Picker (V2). The incentive for the revision was a reader request for a larger number of initial color choices.
17 Jul 2007 by Miran.Uhan
Grayscale and color scale filters.
22 Aug 2012 by wborgsm
How to draw muliline formatted text on a System.Drawing.Graphics object.
27 May 2013 by Sergey Alexandrovich Kryukov
I can give you a simple idea: this is very difficult, nearly impossible.I can tell, because I have a very long experience working with photo editing, using different software, including very best products. Many people are very impressed with background removal/replacement feature. But I was...
20 Apr 2011 by Manfred Rudolf Bihy
Check if the cursors coordinates (as a Point type) lie within in that region.Pont point = ...; //Set mouse coordinates here.GraphicsPath path = ...; // Create your path here.if(path.IsVisible(point)) ... // Check if mouse coordinates are within pathRegards,-MRB
5 Jul 2012 by Matthias Böhnke
Bug Fixes for Reading Barcodes from an Image - III
13 Aug 2012 by gggustafson
This article discusses two lessons learned during the development of a mobile application.
25 Jan 2015 by syed shanu
XBAR and Range Chart using C#
7 Aug 2016 by Sonne170
Preserving alpha channel drawing transparent PNGs
28 Dec 2022 by Andy De Filippo
A simple technique to quickly port hatch effects from Gdiplus to SkiaSharp
24 Jun 2015 by Khaled Abdelhamid
Drawing on a web page on the fly using GDI+ and Flood-Fill Technique
2 Nov 2015 by Farhad Reza
We will design two interesting characters in this tip. The first one is Code Project Bob sticker and the second one is Magpie bird which is the national bird of Bangladesh.
21 May 2020 by Patrick Eckler
Updated AForge.NET Version 2.2.6
11 Apr 2010 by Mohammad Elsheimy
Give the user the flexibility to design his sheet, report, bill, invoice, whatever.
6 Oct 2010 by guidebee
Code example on how to draw enhanced graphics 2D pictures on Windows Mobile
20 Apr 2011 by Henry Minute
As Manfred has said, convert your Path to a Region and use the Region.IsVisible(Point)[^] method.
5 Jun 2011 by georgezou1000
When BMP image is very large image (1700 x 1700), PixelFormat becomes 0.[Thanks for all the reply - The problem is solved by parser the bmp myself.]
9 Jul 2011 by DaveAuld
There is a technical blog article on the subject;Face Recognition Project: Introduction To Face Recognition[^]
2 Jan 2012 by Style-7
Must be:if( post.x >= nodeX[j]-5 && post.x = nodeY[j]-5 && post.y
29 Jan 2012 by Richard James Moss
This post describes how to create a GroupBox control similar to those used in Microsoft Outlook
21 May 2012 by Sergey Alexandrovich Kryukov
You can improve the speed and also simplify your development by not using the class PictireBox. This class is helpful in some simplest situations, when you need to show some static picture, or maybe change it sometimes. When you try to do something dynamic, interactive, animated, etc, this class...
16 Jun 2012 by Dave Kreskowiak
You don't need the Panel at all.Create your own DGV class by inheriting from it, then override the OnPaint method with something like:Public Class MyDGV Inherits DataGridView Protected Overrides Sub OnPaint(e As System.Windows.Forms.PaintEventArgs) ...
6 Nov 2013 by enhzflep
Okay then, well where to begin?I looked at this problem from a bunch of angles, I must've pondered and tried 1/2 a dozen combinations of approaches, but I think I've found one that is workable.Basically, the idea is to do all the drawing on the dialog/window itself and then use button...
15 May 2014 by a_pess
Image File Format
9 Mar 2016 by The Zakies
C++ / CLI into to using C++ CLI and using GDI library
19 Sep 2020 by sdancer75
A graphical time line editor to help you create and prototype animations. It is useful for adjusting variables and checking out how the effects change over time with keyframing and easing/twining functions.
29 Jan 2018 by Shao Voon Wong
Fixing Inconsistent Stroke Width of Chinese Characters
8 May 2009 by Thomas Scheelhardt
Provides an implementation of an ImageButton that will grey out when disabled
17 Dec 2009 by 0x3c0
This depends on how far you are through the process. If you've got the image of the cheque stored on the computer, then you simply use Image.FromFile to load it in, get a Graphics instance using Graphics.FromImage, then use the Graphics.RotateTransform[^] method.From there you can either...
3 Mar 2010 by tolw
I'm not sure why you are using a timer to draw, but if it is a circle you want, and for some reason you do not want to use the Graphics::DrawEllipse methot, than you should deffinately look at parametric equations first (Click[^])I refuse to give you a redy to use code, as I think you can...
3 May 2010 by micahs
Making Cross Domain jQuery AJAX Calls
18 May 2010 by William Winner
You can also programmatically add event hooks. You can write your event handler, so in this case the shell isprivate void panel_Paint(object sender, PaintEventArgs e){}Then, whenever you add a new panel to the form, you add an event handler to that panel like so:Panel newPanel =...
13 Dec 2010 by johannesnestler
You have to copy the color palette too! dstImage.Palette = source.Palette;Btw. you should fix your pointers when using unsafe code!http://msdn.microsoft.com/en-us/library/f58wzh21(VS.80).aspx[^]I used the following version of your snippet:public static unsafe Bitmap...
6 Jan 2011 by Tefik Becirovic
They do not need to worry about a rotation because all transformation will be added after the path creating: // Create a RoundedRectangle: GraphicsPath path = RoundedRectangle.Create(20, 20, 100, 100, 15); // Draw the created RoundedRectangle: ...
26 Jan 2011 by Nish Nishant
Typically this is done using the Bitmap.MakeTransparent method.Example here: http://msdn.microsoft.com/en-us/library/8517ckds.aspx[^][Update]-------------Relevant thread on S.O.:http://stackoverflow.com/questions/388677/can-you-make-an-alpha-transparent-png-with-c[^]
9 Sep 2011 by a_pess
Turn an image to a ColorPicker.
25 Sep 2011 by Philippe Mori
The line if(color = 255,255,255) probably does do what you think it does.First, in C++, operator = is assignment operator and not equality operator.Second, in C++, a comma allows multiple expressions when normally one expression is expected and the result is taken from the rightmost...
2 Jan 2012 by Jochen Arndt
Try this and think about the logical operators:if(post.x>=nodeX[j]-5 && post.x=nodeY[j]-5 && post.y
4 Jan 2012 by XSON-NEON
Hello everyone.First of all, sorry for my bad english.Using:Visual Studio 2005Visual Basic.NETI'm developing a small Media Player, an application which can play most popular music formats, and can view some image formats.I have my custom control (called BtnEx) that inherits...
19 Jun 2012 by MuhtarQong
There is no a way to draw 16bppGrayScale bitmap directly using GDI+.Because you can not get Graphics object from Format16bppGrayScale image. Namely: Bitmap bitmap = new Bitmap(256, 256, PixelFormat.Format16bppGrayScale); Graphics g =...
5 Jul 2012 by Prasad_Kulkarni
GDI stands for Graphic Device Interface.Windows GDI+ is a class-based API for C/C++ programmers. It enables applications to use graphics and formatted text on both the video display and the printer. Applications based on the Microsoft Win32 API do not access graphics hardware directly....
9 Jul 2012 by armagedescu
First you need to open the right theme from the current skin:hThm = OpenThemeData(hWnd, L"WINDOW");After that you may draw the needed thing with DrawThemeBackground,DrawThemeBackground( hThm, hDC, WP_CAPTION, CS_ACTIVE, &rc, 0 );
20 Feb 2013 by Richard MacCutchan
You are recursively calling the Fill method without ever checking if you have reached any of the edges of the picture.
17 Mar 2013 by Sergey Alexandrovich Kryukov
You don't really need to represent a string as a graphic path for proper transform. Transformations are done using...
28 May 2013 by Talking Dotnet
How to execute/run multiple Ajax requests simultaneously
17 Oct 2013 by AlwaysLearningNewStuff
INTRODUCTION AND RELEVANT INFORMATION:FORMER TITTLE OF THE QUESTION:Window produces flicker-like ( slow repainting-like ) effect when resizedI have a complex painting to implement in my main window’s WM_PAINT handler. I have submitted a link to the picture that describes it,...
3 Dec 2013 by Sergey Alexandrovich Kryukov
Flicker can be in part caused by the Windows message WM_ERASEBKGND which you can handle to do nothing, as explained here: http://stackoverflow.com/questions/2473799/gdi-double-buffering-in-c[^] (see answer 3).A widely used "brute-force" way of removing flicker is the use of optimized double...
20 Jun 2014 by Virendra Kulkarni
Steps to implement the “Fit picture to fill the shape” option in PowerPoint like applications using GDI+
24 Sep 2014 by Tero Koistinen
I know this is late, but for persons struggling with same problem, you could try to set FillMode of path to FillMode.Winding like so:...clipPath.FillMode = FillMode.Winding;e.Graphics.SetClip(clipPath, CombineMode.Exclude);
13 Dec 2014 by Afzaal Ahmad Zeeshan
The first step would be to create the Graphics object to work for the drawing. You cannot draw directly, you are required to create a Bitmap, and use the Graphics object to create different things on it. You can create your own Bitmap, by passing your pictureBox (Image) to it, and make the...
28 Sep 2015 by Farhad Reza
This tip describes the use of GDI+ with F# language through Flag design.
11 Dec 2015 by CHill60
Have a look at this CP article Professional C# - Graphics with GDI+[^]There is also a reference zone[^] here on CPOr there always the M$ documentation[^]
19 Feb 2016 by Sergey Alexandrovich Kryukov
I eccentially gave you the answer in my last comment, the one with "A-C-B" and "X-C-Z" angles. Before you clarify your problem, I can give you a solution for the simple roulette you are trying to depict, a flat roulette.Here is the idea. As it seems that you have no problems with rendering...
27 Mar 2016 by Sascha Lefèvre
Quote:Others say that although this is important, they don't actually do much in terms of memory issues.When not using using-statements the CLR eventually comes around to cleaning up those objects but there's no guarantee on when this will happen. So it can lead to inconsistent behaviour. When...
2 Sep 2008 by Uri91
Hello,I'm a high-school student seeking to learn about 3D programming. I have experience with C# and C++, OOP and more.I don't have any intentions of making high-grade stuff with 3D, but I do want to learn something that I might use in the...
2 Sep 2008 by John_Adams
Hi,I would suggest you to visit the following links to know the difference between WPF, DIRECTX and XNA.http://forums.xna.com/forums/t/5278.aspx[^]http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=257213&SiteID=1[^]Hope this helps ...
4 Dec 2009 by Christian Graus
wrote:the only thing that i found is GDI+ programming but it seems so difficult.GDI+ is how all controls are drawn. It's your only option. You need to make your controls owner drawn and write GDI+ code to draw them as you desire them to look. There's tons of articles here on Code Project...
4 Dec 2009 by Abhinav S
If you are looking at starting your project from scratch, you could use WPF or Silverlight instead of winforms. These provide awesome control styling and customization features.
7 Oct 2011 by Rick Shaub
Maybe you could try using the original image and calling TranslateTransform(). The code would look something like this (Warning: not tested): float width = bitmap->GetWidth()* Scale;float height = bitmap->GetHeight()* Scale; Graphics* graphics = new...
9 Jan 2010 by Christian Graus
Two things:1 - the framework ALWAYS creates a Bitmap, even if you ask for an Image instance. At least, it does in .NET.2 - If your core issue is one of speed, the only possible explanation I can see is that you're leaking memory. The GDI+ system does NOT make copies that are somehow...
10 Jan 2010 by Christian Graus
I don't really understand - why do you even need to do this ? A bmp is uncompressed, but a gif, a jpeg, a bmp, etc, all take the same format when they have been loaded in memory.What do you mean 'have no effect' ? Does the image not get saved ? Is it not a bitmap ? If you had a 24 bit image...
10 Jan 2010 by Christian Graus
Please edit your post instead of posting answers that are really questions.Have you stepped through the code in your debugger ? Is a file created at all ? Is your resource loading properly ? I would start by replacing your current handle to save with one you load from disc, of the same file....
28 Jan 2010 by Elof Wecksell
Hi there fellow coders!I've ran into a GDI+ problem. I'm coding C# on .NET Framework 3.5. The problem I'm having is slow response in my application when drawing with my own-developed graphics tools. I'm drawing via the MouseMove events of a Control and the CreateGraphics() method on the...
29 May 2010 by vbn1antu
Hello Sir, I am Vinay From India. I have a problem in my project user interface that i have created office 2007 like interface.Every thing is similar to office 2007 without using paint event of any control nor ribbon controls. I have started creating office 2007 controls from scratch but...
22 Jun 2010 by OriginalGriff
I've never tried a 136MB TIF, but I have dealt with BMP and JPG files that are much larger than that without problems. Edit your existing code, and show us the method that the exception is occurring in - enclose it with the "code block" widget to preserve the formatting.
22 Jun 2010 by Sandeep Mewara
ephrem33 wrote:a .tif image of 136MB sizeThats a big one! I would suggest you to transform into lighter image type and then try to use it. Further, large images like these would be difficult to save and retrieve. Otherwise, have a look at this thread, sounds similar thing with...
22 Jun 2010 by Ryan McBeth
I agree with Sandeep. I wrote a camera driver for Windows CE once. Most of my experience with images comes from Windows CE / Mobile, so I can't fully speak for exactly what is going on in Win32, but I would assume that there are similarities. That image is really getting loaded twice...
31 Aug 2010 by helianthus87
Do you asking about some math to calculate angle between 2 vectors to check the arc? You mentioned about 3 points and i asume there is something like this:[how do i see this]then you need to calculate angle or check dot product between 2 vectors and according to result you will be able...
17 Sep 2010 by CDP1802
A quick search on Google(!) led me to this article here:Adding GIF-animation using GDI+[^]
5 Oct 2010 by ely_bob
Use XNA, this has all the stuff that you need without going into the 3d portion of the API..and in the long run if you want to do things like sparkles, music, explosions.. or whatever else to augment your game you would have easy access to that stuff through XNA.GDI, and it pains me to...
4 Nov 2010 by tlillys
I'm attempting to extend an unmanaged VC++ 6.0 OCX that uses GDI for displaying images and drawing simple graphical elements - lines, points, and rectangles. I am trying to add translucent polygons on top of these elements. Based on articles found here, I believe I've made the code GDI+...
24 Nov 2010 by CDP1802
Nothing against XNA, but WPF would be better for this. A card game may need not much of a GUI, but some may be needed and that would be a pain, especially for somebody who just got started.With WPF you get the user interface and also the cards (including transformations) with far less overhead.
2 Dec 2010 by Emilio Garavaglia
"Provide me the solution" seems implying there must be one and only. But the question is strange, since it mixed up two distinct aspects.Drawing on a bitmap is something that happens in memory, and has no relation with the action of invalidate(), whose purpose is to force the window manager...