I found that there is a difference with the drawing of a custom bitmap brush, when I subclass TGraphicControl versus TCustomControl. The expected behaviour occurs when using the TCustomControl descendant. Each paint starts with the brush in the same position, no matter the location of the control (top-left). When using TGraphicControl however, it appears that the brush is always drawn relative to the top-left of the form. Same behaviour on D5 and DXE2. I hope anybody can offer a reasonable explanation, as to WHY this is happening. (Please note that I am NOT looking for a work-around, I have one.) …

Member Avatar
Member Avatar
+0 forum 1

Hello All, I am working on GDI+ programming and created a windows form to draw lines by mouse. Here is my sample code. [CODE] using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Drawing.Drawing2D; namespace SampleApplication { public partial class frmTest : Form { SolidBrush brush; bool isMouseDown = false; Pen pen; Point startPos; Point curPos; public frmTest() { InitializeComponent(); brush = new SolidBrush(Color.FromArgb(100, Color.Black)); pen = new Pen(brush, 20); // A big size semi transparent pen } private void frmTest_MouseDown(object sender, MouseEventArgs e) { isMouseDown = true; startPos.X = e.X; startPos.Y = e.Y; …

Member Avatar
Member Avatar
+0 forum 1

Hello, I want to create a set of Brush tools as we found in Ms Paint like Crayon, Marker, natural pencil, oil brush and water color brush. How I can achieve this using GDI+? Please help me out on this. Regards, Jayant Paliwal

Member Avatar
+0 forum 0

Iv made conways game of life, but I want the user to be able to select a pre defined pattern or for them to be able to choose different shaped brushes then draw with that brush. Aswell, when I use the radio buttons to change the size, the program goes slow and stops working, does anyone know why that is? And, Iv tried to create an eraser type tool using brush color.empty, but it doesnt work, how can I create an eraser tool, or a button to completely clear what the user has drawn, everything Iv tried has not worked. …

Member Avatar
Member Avatar
+0 forum 3

The End.