Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Print preview images (Read 3441 times)
wayne
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Jun 7th, 2011
Print preview images
Jun 7th, 2011 at 2:34am
Print Post  
Hi,

I can't work out how to change the images in the print preview screen. I added a print preview button to the MoreAnchors sample and have attached the associated function below.
1. Can you tell me what I am doing wrong?
2. Is there any way of changing the icon for the print preview window?

Thanks

void CMoreAnchorsDlg::OnBnClickedPreview()
{
// background displays okay
fcx.LoadPicFromRes((long)AfxGetResourceHandle(),_T("IDR_IMAGE2"), _T("IMAGE"));
fcx.SetPicturePos(picFit);

Picture pic = fcx.GetPicture();
PrintOptions pOpt = fcx.GetPrintOptions();

// image for close is not changed
pOpt.SetPreviewTbarPicture(7,pic);
fcx.PreviewDiagram();
}
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Print preview images
Reply #1 - Jun 7th, 2011 at 6:28am
Print Post  
Hi,

It seems the toolbar control used in the preview window supports only images in .bmp format, and IDR_IMAGE2 is a .gif. If I remember this correctly, the color from the top-left pixel of the bitmap is set as transparent background by default.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
wayne
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Jun 7th, 2011
Re: Print preview images
Reply #2 - Jun 7th, 2011 at 8:09am
Print Post  
Thanks Stoyan,

Got it working, it seems that the size was also critical. Needs to be 32x32.

I presume there is no easy way to change the icon for the print preview window.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Print preview images
Reply #3 - Jun 7th, 2011 at 8:31am
Print Post  
It should be possible to change the icon by sending WM_SETICON message to the preview window. Use the OpenPreviewWindow method instead of PreviewDiagram to get the HWND handle of the preview window.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
wayne
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: Jun 7th, 2011
Re: Print preview images
Reply #4 - Jun 7th, 2011 at 10:27pm
Print Post  
That worked, so I now have a new icon and toolbar images.

Thanks Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint