PC Review


Reply
Thread Tools Rate Thread

Combining a Text or picture into another picture

 
 
avi
Guest
Posts: n/a
 
      7th Apr 2007

Hello,

I have an application that uses the following function to create a
picture to the clipboard. I am not familiar with this kind of API
programming. What i want to do is to add some text or an image to the
image that the function create (For Example "DEMO ONLY"). How can it
be done within the function itself or separately? Thanks a lot

Private Function CreatePicture(ByVal hPic As Long, ByVal hPal As Long,
ByVal lPicType) As IPicture
Dim R As Long, uPicInfo As uPicDesc, IID_IDispatch As Guid, IPic
As IPicture
Const PICTYPE_BITMAP = 1
Const PICTYPE_ENHMETAFILE = 4
With IID_IDispatch
.Data1 = &H7BF80980
.Data2 = &HBF32
.Data3 = &H101A
.Data4(0) = &H8B
.Data4(1) = &HBB
.Data4(2) = &H0
.Data4(3) = &HAA
.Data4(4) = &H0
.Data4(5) = &H30
.Data4(6) = &HC
.Data4(7) = &HAB
End With
With uPicInfo
.Size = Len(uPicInfo)
.Type = IIf(lPicType = CF_BITMAP, PICTYPE_BITMAP,
PICTYPE_ENHMETAFILE)
.hPic = hPic
.hPal = IIf(lPicType = CF_BITMAP, hPal, 0)
End With

R = OleCreatePictureIndirect(uPicInfo, IID_IDispatch, True, IPic)
Set CreatePicture = IPic
End Function

Avi

 
Reply With Quote
 
 
 
 
=?Utf-8?B?T3NzaWVNYWM=?=
Guest
Posts: n/a
 
      8th Apr 2007
I might be off on the wrong track altogether with this suggestion but nothing
ventured, nothing gained. I’ll explain the method in the interactive mode and
then you can automate it from there if you think it will do what you want.

I have previously copied data as pictures to the clipboard for inserting
into other documents by building a copy of the required data in an unused
area of the spreadsheet or even another sheet in the workbook.

Then select the required data including added titles etc and hold the Shift
Key down and select Edit->Copy Picture->Appearance and Format. You can then
paste the picture anywhere you like.

Having told you how to do this in the interactive mode, simply record a
macro to get the syntax for automating.

Regards,

OssieMac


"avi" wrote:

>
> Hello,
>
> I have an application that uses the following function to create a
> picture to the clipboard. I am not familiar with this kind of API
> programming. What i want to do is to add some text or an image to the
> image that the function create (For Example "DEMO ONLY"). How can it
> be done within the function itself or separately? Thanks a lot
>
> Private Function CreatePicture(ByVal hPic As Long, ByVal hPal As Long,
> ByVal lPicType) As IPicture
> Dim R As Long, uPicInfo As uPicDesc, IID_IDispatch As Guid, IPic
> As IPicture
> Const PICTYPE_BITMAP = 1
> Const PICTYPE_ENHMETAFILE = 4
> With IID_IDispatch
> .Data1 = &H7BF80980
> .Data2 = &HBF32
> .Data3 = &H101A
> .Data4(0) = &H8B
> .Data4(1) = &HBB
> .Data4(2) = &H0
> .Data4(3) = &HAA
> .Data4(4) = &H0
> .Data4(5) = &H30
> .Data4(6) = &HC
> .Data4(7) = &HAB
> End With
> With uPicInfo
> .Size = Len(uPicInfo)
> .Type = IIf(lPicType = CF_BITMAP, PICTYPE_BITMAP,
> PICTYPE_ENHMETAFILE)
> .hPic = hPic
> .hPal = IIf(lPicType = CF_BITMAP, hPal, 0)
> End With
>
> R = OleCreatePictureIndirect(uPicInfo, IID_IDispatch, True, IPic)
> Set CreatePicture = IPic
> End Function
>
> Avi
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
combining picture & text in a cell epg Microsoft Excel Misc 0 25th Mar 2009 04:09 PM
Change command button picture to text then back to picture =?Utf-8?B?QWRhbSBUaHdhaXRlcw==?= Microsoft Access 2 11th Sep 2007 02:32 PM
Combining two picture clips =?Utf-8?B?SmVmZkc=?= Windows XP MovieMaker 2 27th Feb 2006 04:41 AM
Background Picture OR text over a picture =?Utf-8?B?Z3JlZw==?= Microsoft Excel Misc 1 30th Mar 2005 12:31 AM
How do I insert text over a picture without losing the picture? =?Utf-8?B?UE1E?= Microsoft Word Document Management 1 4th Feb 2005 05:06 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:41 PM.