473,785 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Picturebox graphic to clipboard

Hello,

This ought to be easy, but I can't figure it out.

In VisualBasic.Net 2003, I've drawn graphics using drawline etc... to a
picturebox. I now want to copy this to the clipboard. I think if I can
convert the image to a bitmap this will work, but I can't figure out how to
do this or to do it more directly. I'd appreciate any help I can get.
Nov 20 '05 #1
2 2456
* "Bob Henry" <ra******@unh.e du> scripsit:
This ought to be easy, but I can't figure it out.

In VisualBasic.Net 2003, I've drawn graphics using drawline etc... to a
picturebox. I now want to copy this to the clipboard. I think if I can
convert the image to a bitmap this will work, but I can't figure out how to
do this or to do it more directly. I'd appreciate any help I can get.


Instead of drawing onto the control directly, draw onto a bitmap
('Graphics.From Image') and then draw this bitmap onto the picturebox.
Then you can copy the bitmap to the clipboard.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

I don't know who you are or why you responded so quickly, but I am very
grateful to you. I got this all to work around 11:30 p.m. last night.
It did cause a performance hit... but not much of one... I can live with
it.

Thanks again!
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #3

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

Similar topics

0
3852
by: Stan | last post by:
In the old days of VB6, an Excel chart image could be pasted into a picture box with Clipboard using the following commands. xlApp.ActiveChart.ChartArea.Copy Picture1.Picture = Clipboard.GetData() I having problems doing this in VB.net? I tried the code shown below, but it does not work. Its a modified version
5
4078
by: TC | last post by:
Hello, Here is what I'm trying to do: -- Make sure both MS Excel and MS Word are running -- Create an Excel chart -- Save the Excel file -- Copy the Excel chart onto the clipboard using Ctrl + C -- Go to Word and look under Edit > Paste Special -- Note there is a source reference and an option to paste the chart as a
4
41410
by: Jon Cosby | last post by:
I'm using this to draw rectangles in a PictureBox image. Not all of the rectangles are complete, and after drawing several, some of them start disapearing. What's the reason for this? Pen selPen = new Pen(Color.White); Graphics graphic = this.PicBox.CreateGraphics(); ..................
1
3097
by: B. Cline | last post by:
Hi, I need to write a conversion routine to split pictures out of about 10000 word documents. (Actually the text is converted to RTF, the pictures should be converted to jpg). I thought I could simply save the word doc as rtf and strip the picture. That works. The problem is getting the picture to save correctly. I can use word to determine which pictures are in the original document and can get them to the clipboard. I can't seem to...
0
3884
by: akh | last post by:
I want to use de Drag and Drop ´s event to move a picture box from a form and within a Picture Box. But I have behaviour if the MyPBox As PictureBox as the Globale varible or not Thanks for your help, Here is the code.
1
2500
by: ray well | last post by:
hi, i need to give the user the ability to extract a rectangular area of their choice from a graphic displayed in a picture box to the clipboard, so they can use it elsewhere. say the graphic has an image of a house with a door in it and the user is interested in the door. the rectangle is selected by placing the mouse on the upper left corner of the door, pressing down on the left mouse button, and draging it to the lower right...
0
2666
by: mhospodarsky | last post by:
Hi-- I am using VB.Net 2002 for this app. I am working with Tiff and jpeg images. I have a picturebox set up that I use to view the images. I have the picture box inside of a scrollable panel.There are two viewing preferences available: to view the image with scrollbars (the original image unsized), and to view the iamge without scrollbars (the image resized to fit within the panel's viewing range.) When I resize the image so that...
3
4469
by: Radu | last post by:
Hi. I need to use a PictureBox ctl (as in VB) - the picturebox should have at least the CLS method, and the backcolor AND forecolor properties. The "Image" control is therefore not what I need. In the toolbox I click on "More Controls", but I can't see a picturebox anywhere. It should be in Comctl32.dll, I think, but how do I set a reference to that dll so that its contents appears in the list of usable controls ?
7
3843
by: winzone | last post by:
I used system.drawing.graphic in C# to draw the Rectangle and Ellipse in PictureBox. In my PC and other my buddy PC show the drawing graphic and color. But my customer PC doesn't show the drawing graphic. In my customer PC, i already installed .net Frame Work 2.0 (SP1). I don't know why missing? I write code like this... Pen penMi = Pens.Blue; void DrawAllMi(Graphics g) { g.DrawRectangle(penMi, x1 - 4, y1 - 4, 8, 8); ...
0
9484
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10350
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10097
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9957
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8983
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7505
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6742
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5518
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.