473,405 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Panel drawing problems.

Hi,

I have some code I'm using in a CompactFramework project. The code works as
expected on the CF, but when using this code on the FullFramework (FF) it
does not work the way I want. It copiles ok, but the screendrawing is not
working 100%.

What the code is supposed to do:
Draw recieved values to a panel so values are displayed countiniously as a
scrolling graph.
Too do the 'scrolling' I first copy the existing bitmap from my panel and
draw it back -1 position to the left.
Then I clear the rightmost part of the panel
and finally draw the new recieved value on the newly cleared area.

It is the 'scrolling' part that is not working on FF.

Does anyone have any hints or clues on what I'm doing wrong here ? (Please
see code below)
/*From constructor
DrawBitMap = new Bitmap(DrawPanel.Width, DrawPanel.Height);
DrawGrapics = Graphics.FromImage(DrawBitMap);
*/

internal void DrawAdvancedMode(int sample)
{
int h = DrawPanel.Height;
int w = DrawPanel.Width - 1;
DrawGrapics.DrawImage(DrawBitMap, -1, 0); // scroll left. I think this
where the problem is*******
DrawGrapics.FillRegion(WhiteBrush, new Region(new Rectangle(w - 1, 0, w,
h))); // clear plot region

int y = h-(int)((double)h * ((double)sample/MAX_SAMPLE));
int x = w - 1 + i;

// plot
DrawGrapics.DrawLine(BluePen, x, y, LastPoint.X, LastPoint.Y);
DrawPanel.Invalidate();
LastPoint.X = x;
LastPoint.Y = y;
LastPoint.X -= 1;
}

Thanks for reading.

regards,
Leo
Nov 17 '05 #1
2 2323
Hi again,

Forgot to post this code, and guess it is needed :)

/*from constructor
DrawPanel.Paint += new PaintEventHandler(PaintPanelSignal);
*/

internal void PaintPanelSignal(object sender,
System.Windows.Forms.PaintEventArgs e)
{
e.Graphics.DrawImage(DrawBitMap, 0, 0);
}
regards,
Leo
Nov 17 '05 #2
Me again:)

I just noticed the group 'dotnet.framework.drawing'. and as that looks like
a more appropriate group for my question I've asked my question there.

Subject "Scroll Panel Image"

regards,
Leo
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Skidmore | last post by:
I am building an application that will fade one panel to another panel. Both panels will have picture boxes in them (thumbnails). This is what I have tried: private void...
13
by: Martin Ho | last post by:
I know this must be trivial for many of you. But I am playing with this and can't figure it out. I have a form, on that form is one panel which has 3 textboxes, when I run my program and...
6
by: QT | last post by:
Dear sirs, I want to create panel or label field for each database records. I am using following codes for each database row to create panel field. 'Panel ' i = 1
4
by: Sarika | last post by:
I migrated a VB6.0 application to VB.NET. This app has a drawing area, which is a panel. The user can drag and drop several objects on this drawing area and can also draw lines, boxes etc. The app...
7
by: Sharon | last post by:
I’m using the Panel control that contains a PictureBox control (for implementing the http://www.codeproject.com/cs/miscctrl/PictureBox.asp). The Panel is set to AutoScroll = true. I wish to...
3
by: Robert W. | last post by:
In my WinForms app I'd long ago implemented a drag & drop mechanism just like is used in PowerPoint when one wants to rearrange the order of the slides. Specifically, a thin black line is shown...
1
by: lodhaakhil85 | last post by:
Hi I'm a newbie to C# and GDI+.I am writing an application that will display some strings from a file on a panel. There are a few of problems I am facing : 1.How do make the panel re-adjust...
8
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In...
11
by: dongarbage | last post by:
Hi there, I'm very much a C# novice. How do you do freehand drawing on a panel with a mouse in c#? Thanks, Don
1
by: YouPoP | last post by:
I am doing an app (C# 2.0) where you can draw in a panel with your mouse in "real time". I actually have 2 problems; 1- it does not really is "real time", if your mouse move fast or very fast the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.