Questions tagged [onpaint]

An event that is triggered when a GUI component needs to be repainted

onPaint is the method responsible for performing the paint act triggered from a PaintEvent. This event is triggered when a GUI component needs to be repainted, usually as a result of a change to the underlying data behind the GUI component. onPaint is responsible for the physical display of the component, and in particular, applying the themes and colors appropriate for the application/output device.

198 questions
0
votes
1 answer

Is there alternative for the drawing image in C# winforms?

I using g.DrawImage for output Image like this: g.DrawImage(Resources.dayPict, x1, myY, 20, 20); But this way not fast. How I can draw image faster? P.S. When I draw many images I have delays. Is there a special buffer for this goal?
0
votes
0 answers

draw line on form show/visible C++

Hey I want to draw something when a form pops up. I noticed the OnPaint even but it doesn't show my drawing. When I add it to a button it does show what I wanted to draw. This is what I draw: void TSelectElementForm::DrawLinesInLayout() { …
Bart
  • 717
  • 1
  • 9
  • 28
0
votes
1 answer

line doesnt located inside the paintbox

I did: __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { DrawingBoard = new Graphics::TBitmap; DrawingBoard->Width = this->PaintBox1->Width; DrawingBoard->Height = this->PaintBox1->Height; } void…
user687459
  • 143
  • 5
  • 17
0
votes
1 answer

NETCF - Optimized Repaint (onPaint)

I want to ask for suggestions on how to optimize a repaint in Compact Framework? GetHashCode() didn't help because it always return a different hash code. Anyway, I have a program which you can drag and resize an object in run time. This object is a…
jaysonragasa
  • 1,076
  • 1
  • 20
  • 40
0
votes
1 answer

Getting empty update rectangle in OnPaint after calling InvalidateRect on a layered window

I'm trying to figure out why I've been getting an empty update rectangle when I call InvalidateRect on a transparent window. The idea is that I've drawn something on the window (it gets temporarily switched to have an alpha of 1/255 for the…
Shawn
  • 21
  • 3
0
votes
1 answer

MFC, c++ When showing and hiding ctrls on the screen can I disable paint for a bit

I have a screen with say 20 controls on it. I want to show all twenty, then hide only the ones that don't relate to what I'm working on. psudoCode. for each element show element for each element in hide list hide element. My problem is…
baash05
  • 4,394
  • 11
  • 59
  • 97
0
votes
1 answer

OnPaint event during a callback when the form is below?

Imagine the following scenario: this.SetStyle(ControlStyles.UserPaint, true); //this doesn’t change anything … void OpenSomeForm() { SomeForm sf = new SomeForm(); sf.SomeEvent += new … (SomeEventOcurred); sf.ShowDialog(); } private…
Martin Marconcini
  • 26,875
  • 19
  • 106
  • 144
0
votes
2 answers

Growing user control not updating

I am developing in C# and .Net 2.0. I have a user control that draws cells (columnar) depending upon the maximum number of cells. There are some drawing routines that generate the necessary cells. There is a property NumberOfCells that adjust the…
Lorentz
  • 181
  • 1
  • 3
  • 13
0
votes
2 answers

GDI+ Problem encountered in drawing multiples rectangles on the form

I whant to draw a table in C# Windows Forms using GDI+. When the number of rectangles is too large for all rectangles to be displayed on the form, it does not scroll. And can not access those who did not fit the form. What I need to do to see…
Emanuel
  • 6,622
  • 20
  • 58
  • 78
0
votes
1 answer

Free hand Drawring on JFrame, Color + Point[] Storage and rendering failing

The following program is supposed to allow free hand drawing on the one frame and the other as a button to open the color selector. The code for the main class can be found: package clickTesting; import Desksnap.Utils.Line; import…
Jordan
  • 11
  • 3
0
votes
1 answer

Defining Regions for Venn Diagram using Graphics Regions

I have created a Venn diagram using simple Graphics functions provided by WinForm in the onPaint event. Here is my code for creating the Venn. using (Brush brushLeft = new SolidBrush(LeftVennColor)) { leftvennPath.AddEllipse(leftVenn); …
user1821499
  • 301
  • 4
  • 22
0
votes
1 answer

Drawing large amount of images on Panel C# is still slow and flickers

I am trying to create a program that is able to analyze DNA data and visualize the differences compared to a reference sequence of DNA. This involves a big number of letters that I want drawn on a Panel with each base (A, C, G, T) having a different…
0
votes
1 answer

Why does Windows Forms control's property cannot be changed during the OnPaint event

I use the OnPaint (c#) event to draw something in my form. I want to get the value of a variable during the OnPaint process. But I cant get it during, only before or after the OnPaint process... In fact, the variable is like a counter that I want to…
Gafda
  • 13
  • 2
0
votes
1 answer

Why is my overridden OnPaint method not invoked?

I have created custom picture buttons and now need to do some additional drawing in the main Form (that is using these buttons), so I overrode its OnPaint method. For some reason it is never called and I do not know why. public partial class Form1:…
John V
  • 4,855
  • 15
  • 39
  • 63
0
votes
1 answer

Rectangle can't be drawn on the panel by mouse dragging runtime

I am trying to draw a rectangle on a panel, but nothing is drawn. Below is the code to show how I draw a rectangle on the panel. In my code SetSelectionRect() is used to set the rectangle to be drawn. For these I use following methods. private…
DhavalR
  • 1,409
  • 3
  • 29
  • 57