Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Copying picture to a canvas
Topic Summary: How to copy an Object's picture onto a canvas?
Created On: 8-Feb-2008 12:48
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 8-Feb-2008 12:48
User is offline View Users Profile Print this message


Joe Sarkic

Posts: 31
Joined: 13-Jun-2005

I am looking for a way to copy an Object's static picture (any DOORS supported format) onto a DOORS canvas (DBE). I suspect this would require some bitmap manipulation.

Has anyone found a way to do this? Is it even possible?

Edited: 8-Feb-2008 at 13:42 by Joe Sarkic
Report this to a Moderator Report this to a Moderator
 8-Feb-2008 13:58
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

In the help file look for:

loadBitmap
drawBitmap
destroyBitmap
Report this to a Moderator Report this to a Moderator
 8-Feb-2008 14:11
User is offline View Users Profile Print this message


Joe Sarkic

Posts: 31
Joined: 13-Jun-2005

Thanks for the reply Ron, but the loadbitmap function reads from a file, not an Object.

I need to be able to load a picture from within an Object.
Report this to a Moderator Report this to a Moderator
 8-Feb-2008 14:43
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

Then look at:

string exportPicture(EmbeddedOleObject oleObject, string fileName, int format)
Report this to a Moderator Report this to a Moderator
 8-Feb-2008 15:55
User is offline View Users Profile Print this message


Joe Sarkic

Posts: 31
Joined: 13-Jun-2005

The exportPicture function only supports PNG output. Once created, the file needs to be converted to BMP format to load back into a canvas. This conversion can be done with a system() call to a conversion program. It's a round-about way, but it does work.

I would prefer to do direct loading onto a canvas from an Object.

For BMP format pictures that are imported into an object, they can be loaded onto a canvas directly as follows:

if (getPictFormat(current Object) == "BMP")
{
string bitmapFileName = getPictName(current Object)
bitmap(canvasDBE, bitmapFileName, 0, 0)
}

Other formats seem to need a round-about way as discussed above.
Report this to a Moderator Report this to a Moderator
 8-Feb-2008 16:04
User is offline View Users Profile Print this message


ron lewis

Posts: 650
Joined: 20-Sep-2004

The export picture supports other formats depending upon the integer value you give to it.

What better may be asked is why are you sending object to canvas instead of a richtext box?
Report this to a Moderator Report this to a Moderator
 8-Feb-2008 16:58
User is offline View Users Profile Print this message


Joe Sarkic

Posts: 31
Joined: 13-Jun-2005

richtext works for OLE objects, but does not seem to accommodate static pictures. In addition, the richtext box only has a vertical scrollbar. For large pictures, need a horizontal scrollbar as well. This is the reason why a canvas was being used in the first place.

Edited: 8-Feb-2008 at 17:28 by Joe Sarkic
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.