473,657 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.OleGraphCont rol.ChartArea.C opy).
Next open an instance of MS Paint, paste the clipboard into the file and
save as something like "Picture.bm p" 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 9014
Hi, Tim.
>Next open an instance of MS Paint, paste the clipboard into the file
and save as something like "Picture.bm p"
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
.DisplayBlankIm age 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.OleGraphCont rol.ChartArea.C opy).
Next open an instance of MS Paint, paste the clipboard into the file and
save as something like "Picture.bm p" 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
13735
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 mostly scanned newspaper atricles which are too big to just display on a form so I need the zoom and scroll features. Im using access 2003
9
2550
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 if the Activate event does NOT fire?
0
1908
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 still exists (I tried both ways). Imagine you have a Console.WriteLine( ) in the paint method so you know when its getting called. Also there is no place in the code that userControl.Paint is -+ so the event is *never* removed.
7
1823
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 question is..how would I save the tif images as soon as it is initially painted, and then restore the image in a paint event. It seems to me that there should be some sort of a SaveImage method and a RestoreImage method that would be fast. Note:...
18
6709
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 I've already created on my computer. Whenever I go to open the script file (whose icon shows that it's a SQL Server Query File and I've got the file type set to open with SQLWB - SQL Server Management Studio), the file opens in Notepad instead of...
7
3248
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 am trying to develop a photoalbum (also posted a topic called "array / mysql question"). Of course I can use some wonderful open source albums but at the same time I want to get more familiar with all the ins and outs so my idea is a list of...
0
1418
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 verbatim. I receive no errors, and the debugger shows all of the code being executed, but my new color never appears when I click on the cell of the grid. Are there any general things I can look for besides things like making sure my rectangle is...
4
9057
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 set out however i cannot get paint to open the file being viewed. I get the error "File path not found" but i'm not sure why, i thought it would be as simple as adding the "filepath" variable onto it. Here's the code i currently have:...
2
5728
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() { int x = 5; DEBUG("variable x is %d",x); }
0
8384
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8820
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
8718
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
8499
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
8601
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
5630
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
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.