473,385 Members | 2,243 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,385 software developers and data experts.

Opening MS Paint and Pasting Via Code

In my not too successful attempts to get an OLE chart object (Graph
11.0) that has been manipulated on a form to be reproduced on a report,
I am considering the following procedure. First copy the graph area to
the clip board (easy enough using Me.OleGraphControl.ChartArea.Copy).
Next open an instance of MS Paint, paste the clipboard into the file and
save as something like "Picture.bmp" in the same directory as the FE
Access app. A picture control on the report would link to Picture.bmp.

I'm not sure about opening an instance of MS Paint and saving the file.
Also not sure about pasting - I regularly use Terry Kreft's API code
posted on the Access Web for copying things toi the clipboard, but I'm
not sure how to paste.

Any suggestions on any or all of:

1) Opening MS Paint
2) Pasting clipboard contents to MS Paint
3) Saving MS Paint file

would be very much appreciated, thanks in advance.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Oct 17 '06 #1
1 8939
Hi, Tim.
>Next open an instance of MS Paint, paste the clipboard into the file
and save as something like "Picture.bmp"
A search of Google groups for "mspaint automation" suggests that what
you intend to do is not possible without resorting to a kluge like
SendKeys to "control" an instance of MS_Paint.

Under Win2K you could use the Kodak Image Edit Control (ImgEdit.ocx)
something like this
With Me.ImgEdit1
.DisplayBlankImage 1, 1, , , wiPageTypeRGB24
.ClipboardPaste
.SaveAs "c:\foo.bmp", wiFileTypeBMP
End With
Unfortunately, WinXP doesn't include ImgEdit.ocx :( .
Gord
Tim Marshall wrote:
In my not too successful attempts to get an OLE chart object (Graph
11.0) that has been manipulated on a form to be reproduced on a report,
I am considering the following procedure. First copy the graph area to
the clip board (easy enough using Me.OleGraphControl.ChartArea.Copy).
Next open an instance of MS Paint, paste the clipboard into the file and
save as something like "Picture.bmp" in the same directory as the FE
Access app. A picture control on the report would link to Picture.bmp.

I'm not sure about opening an instance of MS Paint and saving the file.
Also not sure about pasting - I regularly use Terry Kreft's API code
posted on the Access Web for copying things toi the clipboard, but I'm
not sure how to paste.

Any suggestions on any or all of:

1) Opening MS Paint
2) Pasting clipboard contents to MS Paint
3) Saving MS Paint file

would be very much appreciated, thanks in advance.
--
Tim http://www.ucs.mun.ca/~tmarshal/
^o<
/#) "Burp-beep, burp-beep, burp-beep?" - Quaker Jake
/^^ "Be Careful, Big Bird!" - Ditto "TIM-MAY!!" - Me
Oct 17 '06 #2

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

Similar topics

4
by: Shumit Rehman | last post by:
Hi I have a table which has path names to photos I would like to view. I would like to open some/any kind of image viewer(Paint) to see the picture when I click the pathname. The pictures are...
9
by: MLH | last post by:
Say I open a form (MyForm) in design view, then I close it and dbl-click it in the database window to open it. Shouldn't the Activate event occur in all such situations? What might the case(s) be...
0
by: vooose | last post by:
Consider a UserControl to which you do userControl.Paint += new PaintEventHandler(paint_method) If you don't like that way, and prefer to override onPaint( ) then the problem stated below...
7
by: hamil | last post by:
The following code will display a tif file on a form. When another form is moved over the tif image, the tif image is erased where the form was moved. A paint event occurs when this happens. My...
18
by: mollyf | last post by:
I just installed SQL Server 2005 on my PC (the developer's edition) yesterday. I have some scripts written by one of my coworkers to create some tables and stored procedures in a database that...
7
by: Martien van Wanrooij | last post by:
I have been faced a couple of times with the situation that I wanted to write a script and was worried about a too frequent opening and closing mysql connections. To give some examples: 1)I...
0
by: =?Utf-8?B?TWljaGFlbCBKLiBWaXNpbnRpbg==?= | last post by:
Hi All, I am implementing the Paint Method override described in the Help (DataGridTextBoxColumn.PaintMethod). I believe that I have implemented the procedure example displayed in the Help...
4
by: Crisis | last post by:
Basically, i have a program that shows images and i want it to open the image currently selected with mspaint so they can edit it. Currently i can open paint when the user clicks a button i have...
2
by: mark.bergman | last post by:
I am porting some old code from Digital Unix to Linux using token pasting, which is failing to compile (code simplified): #define DEBUG(strg,v) printf("debugoutput: "##strg##".\n", v); main()...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...

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.