Re: Problem copying Picturebox to Clipboard



"Jennifer W" <jenniferw@xxxxxxxxxxxxxxx> wrote in message news:%231$i06TgHHA.3368@xxxxxxxxxxxxxxxxxxxxxxx

in VB6, Winxp I'm printing to a picturebox and then copying that
to the clipboard. It's working pretty well except when I paste the
clipboard into a Word document, there's a large blank space at the
bottom of the picture I just pasted.

You need to explain *exactly* what it is you are trying to do, and you need to show us your code that draws to the Picture Box. Your code is a bit "iffy" at the moment because it does not take into account the differences between different machines, but if you are running your machine at the standard 96 dpi setting (which is very likely) and if you have left the ScaleMode of the Form itself at its default seting of Twips (which, looking at your specific Picture Box Height and Width values, is extremely likely) and if your Picture Box has the standard borders then your code currently creates a Picture Box such that the bitmap it contains is 996 pixels wide by 1052 pixels wide (996 x 1052 pixel bitmap). That is an almost (but not quite) square bitmap. Is that the size of the bitmap you are trying to create?

And are you sure that your drawing code needs to be using a ScaleWidth of 18000 and a ScaleHeight of 8500? Those sizes bear no relation at all to the aspect ratio of the bitmap. There's nothing wrong with doing that of course if that's what you really want, but is that really what you want to do? And does your drawing code take that into account?

And, do you actually know the difference between Width and ScaleWidth (and Height and ScaleHeight), or the differences between machines which can cause your bitmap to be a different size depending on which machine your code is running on unless your code takes account of them? Do you know how those things work? You need to explain *exactly* what it is you are trying to do, and you need to show your code, including the drawing code.

Mike



.



Relevant Pages

  • Re: Image scaling (sign taken from a Pc Pen)
    ... Assuming you get a non-null result back it will return you an HBITMAP, in your case since you just want to display this in a picture ... box then grab my OLEPicture library to wrap the returned Bitmap in an OLE StdPicture object which you can simply assign to a picture ... If the image in the clipboard is in DDB format then have a look at the code from the DDB tutorial on my site which wraps the DDB ...
    (microsoft.public.vb.winapi.graphics)
  • Re: Problem copying Picturebox to Clipboard
    ... picture 'width' relates to anything. ... an almost square bitmap. ... And does your drawing code take that into account? ... or the differences between machines which can ...
    (microsoft.public.vb.general.discussion)
  • Re: How to copy a pitcurebox to clipboard
    ... in the picturebox copied to the clipboard. ... original post you asked how to copy a picture from a picture box to the ... now turns out that you want to copy a bitmap image of some controls that you ... Dim myDC As Long ...
    (microsoft.public.vb.general.discussion)
  • Re: Graph Plotting - Mike
    ... it with Autoredraw set to True and also with a picture loaded into its ... Then we created a device context using the CreatCompatibleDC API. ... draw into that bitmap or when we want to "blit" it somewhere (pens, brushes, ... machines that are currenty running at full colour depth (which is most ...
    (comp.lang.basic.visual.misc)
  • Re: Image scaling (sign taken from a Pc Pen)
    ... With a color picture what you have to do is compare Wo& and w&, Ho&, h&. ... You create a new array wich is and &HFFFFFFFC byte width ... > box then grab my OLEPicture library to wrap the returned Bitmap in an OLE StdPicture object which you can simply assign to a picture ... > If the image in the clipboard is in DDB format then have a look at the code from the DDB tutorial on my site which wraps the DDB ...
    (microsoft.public.vb.winapi.graphics)