473,661 Members | 2,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't get bitmap from the clipboard

Depending on the program that does the copy, my c# program can not get the
bitmap data off the clipboard. The code used to get the data is:

IDataObject o = Clipboard.GetDa taObject();
if (o.GetDataPrese nt(typeof(Bitma p)))
{
Bitmap bm = (Bitmap)o.GetDa ta(typeof(Bitma p));
if (bm != null)
{
this.pictureBox 1.Image = bm;
this.pictureBox 1.SizeMode = PictureBoxSizeM ode.StretchImag e;
}
else
MessageBox.Show ("Bitmap is null?!");
}
else
MessageBox.Show ("Not a bitmap!");

Here's the deal... If Word, Paint, or a test c# program copy a bitmap to the
clipboard I can get it with the code snippet above. However, if StorComm's
medview program does the copy to the clipboard, the GetDataPresent reports
that a bitmap is there, but the Getdata returns a null. However, Paint and
Word can both paste this image.

Any ideas on ways to solve this would be appreciated...C huck
Dec 20 '05 #1
0 1086

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

Similar topics

1
1366
by: LoSTMaN | last post by:
Hi, Did someone have a idea why this code always return False when i drag a filename.bmp in my PictureBox. Private Sub PictureBox1_DragEnter(ByVal sender As Object, ByVal e As DragEventArgs) Handles PictureBox1.DragEnter If e.Data.GetDataPresent(DataFormats.Bitmap) Then ============>>> Here, always return false e.Effect = DragDropEffects.Copy
2
2527
by: John | last post by:
The following 4 lines add a border to a bitmap and save it into clipboard, however it also add a border to the bitmap on the screen. I want to create a temp copy of the bitmap and add a border to it without affecting the bitmap on the screen. Any suggestions? Thanks ''''' Dim g As Graphics = Graphics.FromImage(MyPpic.Image) Dim pen As New Pen(Color.Gray) g.DrawRectangle(pen, 0, 0, MyPpic.Image.Width - 1,
0
2941
by: BIG_j | last post by:
I have dynamic image(s) on the clipboard that I need to save as a transparent gif. There are a number of posts regarding MakeTransparent but I cannot get this to work for what I am trying to do. I am NOT loading the picture into a form and there are no paint events to consider. I am simply loading the image from the clipboard and saving it to a file. Anyone have a solution or workaround?? Here is the code snippet...
5
3993
by: Paul_Madden via DotNetMonster.com | last post by:
How can I get a bitmap of a Form using .NET 1.1 (ie NO CopyFromScreen) -- Message posted via DotNetMonster.com http://www.dotnetmonster.com/Uwe/Forums.aspx/dotnet-csharp/200605/1
8
2489
by: active | last post by:
Guess I'm looking for someone who likes to work difficult puzzles. I can't seem to ever retrieve a palette handle from the clipboard. Below is a simple test program that demonstrates the problem. The program uses windows api to get a handle to a palette from the clipboard. The palette needs to be put there by another program - maybe Photoshop.
12
3349
by: active | last post by:
I've been looking on the Internet for a way to convert a DIB to a Bitmap without success. Now I'm wondering if that is the approach I should be taking. All I want to do is display the DIB or draw it into a Bitmap. Is there a graphics method that can help?
6
4437
by: \Frank\ | last post by:
On the Internet there are many descriptions of the memory layout for a DIB. But none that I can find for a Bitmap. Is that because a Bitmap's layout depends on a related device. If that's the case, is a clipboard's Bitmap layout always related to the screen?
1
3302
by: info | last post by:
Hi All, I am struggling with this from 48 hours and cannot succeed, of course I've tried: DataObject dObj = new DataObject(); dObj.SetData(DataFormats.Bitmap, false, bitmap); Clipboard.SetDataObject(dObj, true);
20
6997
by: Joe Duchtel | last post by:
Hello - I have the following code to get a bitmap from the clipboard and to save it to a *.png file ... Dim lData As IDataObject = Clipboard.GetDataObject() If lData.GetDataPresent(DataFormats.Bitmap) Then Dim lPictureBox As New PictureBox
0
8343
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
8856
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
8762
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
8545
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
8633
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
5653
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
4347
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2762
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1747
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.