473,395 Members | 1,720 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,395 software developers and data experts.

PictureBox problem

I am drawing in a picturebox and am having some problems. I display
outputted images in the picturebox. If the image is too big for the
client area then i have scrollbars. The problem is that once i draw a
bitmap to the picturebox I have trouble displaying graphics inside the
picturebox. I

pictureBox1.image = Image.FromFile("OutBinary.bmp");
This image is displayed in the picturebox with scrollbars. Then i try to
do the following. Once i touch the scroll bars the original bitmap image
gets displayed again. How do i change the image to display only the new
polygon data.

_canvasImage.MakeTransparent();
_canvasGraphics = Graphics.FromImage(_canvasImage);

_canvasGraphics.Clear(Color.White);
_canvasGraphics = pictureBox1.CreateGraphics();
SolidBrush brush = new SolidBrush(Color.Black);
_canvasGraphics.Clear(Color.White)

.......do various calculations to get polygon points

_canvasGraphics.FillPolygon(brush,polgon_points);
this.displayscrollbars()
this.setscrollbarvalues();
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 16 '05 #1
1 4156
Read the #1 GDI+ FAQ

--
Bob Powell [MVP]
Visual C#, System.Drawing

Image transition effects, snap-to-grid and Layered Windows are
all discussed in May's edition of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml


"James Dean" <m_*******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I am drawing in a picturebox and am having some problems. I display
outputted images in the picturebox. If the image is too big for the
client area then i have scrollbars. The problem is that once i draw a
bitmap to the picturebox I have trouble displaying graphics inside the
picturebox. I

pictureBox1.image = Image.FromFile("OutBinary.bmp");
This image is displayed in the picturebox with scrollbars. Then i try to
do the following. Once i touch the scroll bars the original bitmap image
gets displayed again. How do i change the image to display only the new
polygon data.

_canvasImage.MakeTransparent();
_canvasGraphics = Graphics.FromImage(_canvasImage);

_canvasGraphics.Clear(Color.White);
_canvasGraphics = pictureBox1.CreateGraphics();
SolidBrush brush = new SolidBrush(Color.Black);
_canvasGraphics.Clear(Color.White)

......do various calculations to get polygon points

_canvasGraphics.FillPolygon(brush,polgon_points);
this.displayscrollbars()
this.setscrollbarvalues();
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 16 '05 #2

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

Similar topics

2
by: David Ricker | last post by:
I have created a PictureBox control which can have it's Image property directly bound to an image field in a database. This works perfectly for showing the images that are in the database. When I...
2
by: active | last post by:
Problem: The PictureBox display appears to have the image cut off. I.e., the image bottom does not display although the PictureBox has room for it. It occurred to me that what was displayed was...
4
by: Yash | last post by:
Have used DrawLine() method to draw some lines in the picturebox (sort of a barcode) in the picturebox paint event. This diagram has to be saved as an image in bmp or tiff format. But the problem...
4
by: TomA | last post by:
Hi All, I have a picturebox on a form containing the photo of a person. As you advance through the records, the photo updates. Rather than storing the images in an inefficient blob field in a...
4
by: munibe | last post by:
Hi, i have a problem about picturebox control. if you may help me, i will be so happy. i have a picturebox named pic_map, and i added a button named customer_button, my wish is to add a new small...
3
by: kirk | last post by:
I have a form with a PictureBox control on it. The .Image property is set to a PNG file(which shows the picture of the US map) with some transparency in it. The .BackColor property is set to...
4
by: gerardianlewis | last post by:
Any help appreciated. (VB.NET under XP and Vista, SP1 installed) My code, inherited from a VB6 version of an app that ran under W98, loads an image from a file into a PictureBox. The user may...
0
by: =?Utf-8?B?RG9jdG9y?= | last post by:
I am making an application that streams video from a web camera onto the client area of a PictureBox on a Windows CLR Form in MS Visual Studio 2005 (using C++). The streaming video works fine, and...
5
by: AWW | last post by:
XP VB 2005 running an example from help that creates a picturebox in code - the picturebox is not created. If I comment out the "Dim Box as New PictureBox" and create it in Design mode - 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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.