Issue 60445 - Clipboard paste issue with images from vs.net
Summary: Clipboard paste issue with images from vs.net
Status: CLOSED DUPLICATE of issue 85661
Alias: None
Product: Writer
Classification: Application
Component: code (show other issues)
Version: OOo 2.0.1
Hardware: All Windows XP
: P3 Trivial (vote)
Target Milestone: ---
Assignee: eric.savary
QA Contact: issues@sw
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-12 14:15 UTC by sebcrabbe
Modified: 2008-02-02 01:54 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description sebcrabbe 2006-01-12 14:15:06 UTC
Images copied to the clipboard from vs.net 1.1 & 2.0 programs cannot be copied 
into Open Office Programs as the paste icon or paste special icons do not 
appear. The code from Visual studio 2005 is thus:

Dim bmp2 As System.Drawing.Bitmap = bmp 
'bmp is another bitmap object already in existence
Clipboard.SetImage(bmp2) 
'setImage takes an image object which bitmap inherits from


'another way of pasting to clipboard also does'nt work
Dim dataObj As DataObject = New DataObject
dataObj.SetData(DataFormats.Bitmap, True, bmp) 
'dataformats.bitmap is "CF_BITMAP" according to MSDN
Clipboard.SetDataObject(dataObj, True)

The above code will place the image onto the clipboard and it is retrievable by 
other programs (such as Adobe Photoshop, wordpad, corel draw, MS office etc.) 
just not open office. When other formats are copied onto the clipboard such as 
CF_HTML of CF_TEXT it works fine just not images.

from interrogating the clipboard at runtime (using the code below) it appears 
to have copied two items to the clipboard, A System.Drawing.Bitmap followed by 
a Bitmap. Not sure if that's relevant or not.

Dim o As DataObject = Clipboard.GetDataObject
Dim s As String

For Each s In o.GetFormats
    MsgBox(s)
Next

sorry it's not much to go on but it would be a great help if it could get fixed 
as it's getting annoying copying the image into painbrush then recopying it to 
the clipboard
Comment 1 michael.ruess 2006-01-12 14:37:26 UTC
Reassigned to ES.
Comment 2 eric.savary 2007-03-16 11:01:23 UTC
@AMA: can you help reproducing this?
Comment 3 Mathias_Bauer 2007-05-07 12:48:41 UTC
@sebcrabbe: Please provide complete macro including bitmap so that we can
directly reproduce the problem by executing your demo
Comment 4 sebcrabbe 2007-05-09 11:18:45 UTC
 hi, here is an example routine that illustrates it, you should be able to 
paste an image into a wordpad or office document afterwards, but not openoffice

Private Sub makebmp(ByVal sender As System.Object, ByVal e As System.EventArgs) 
Handles makebmpc.Click
        Try
            'a very simple test routine to illustrate issue 
            'note you may need to import system.drawing
            'the below makes use of GDI+ calls wrapped up in .net objects

            'create a bitmap and get a handle on the graphcis
            Dim bmp As Bitmap 'a bitmap class object
            bmp = New Bitmap(250, 250) 'specifiy size
            Dim gr As Graphics = Graphics.FromImage(bmp) 'create a graphics 
object from the bitmap

            'draw stuff on the bitmap
            Dim r As New Rectangle(10, 100, 230, 50)
            gr.Clear(Color.Wheat)
            gr.DrawRectangle(Pens.DarkBlue, r)
            gr.FillRectangle(Brushes.LightBlue, r)
            gr.DrawString("A very simple test", New Font("Arial Black", 14), 
Brushes.Blue, r)
            gr.Dispose()

            'create a dataobject 
            Dim dataObj As DataObject = New DataObject

            'add the bitmap
            dataObj.SetData(DataFormats.Bitmap, True, bmp)

            'copy it to the clipboard
            Clipboard.SetDataObject(dataObj, True)

            'now try and paste it into a document. you can under wordpad, 
microshaft office etc.
            'but the paste icon does not appear in openoffice

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
Comment 5 andreas.martens 2007-06-25 13:29:53 UTC
ama->es:
No, sorry. You need someone with Visual Basic and StarOffice installed to
confirm this. I didn't found a developer with installed Visual Basic (and
StarOffice). So I cannot help to confirm this problem.
Comment 6 watersrw 2007-11-07 19:19:32 UTC
I can confirm this issue occurs with Paint .NET (free) and Openoffice 

I copy something in Paint .NET and there is nothing to paste in oo.org, yet ms
paint will allow it. I use a workaround of pasting into Visio then copying and
pasting into oo.org!
Comment 7 sebcrabbe 2007-11-08 11:41:37 UTC
Just to add, if it occurs with paint .net as well it'll be a .net issue and not 
a visual basic issue as such. (all the .net languages compile up to microsoft 
intermediate language (MSIL) anyway) Perhaps someone could try and  alter + 
compile the code as C# to confirm it?

Comment 8 kpalagin 2008-01-31 19:38:12 UTC
Dup of confirmed http://qa.openoffice.org/issues/show_bug.cgi?id=85661.
Please move your votes and CC.

*** This issue has been marked as a duplicate of 85661 ***
Comment 9 kpalagin 2008-01-31 19:41:03 UTC
Closing.