Board index » cppbuilder » form that is bigger than screen size?

form that is bigger than screen size?

Hello,

I have a form where I draw a (complex) picture on using Canvas->LineTo and
so on.
I need to draw the picture on size A0!

When I enlarge the form, the picture is redrawn at "higher resolution" which
is OK.
Is it possible to make my form bigger than the size of my screen, i.e set it
to be at 841x1189 mm?

The problem is that when I maximise my window, save it as bitmap and paste
it in powerpoint on an A0 page, the quality of the whole image reduces since
the A0 is much bigger than my window size.

Since I redraw the picture, my idea is to redraw it at a window that is a
big as my A0 page, hence having a bitmap at "real" size.

Any help is appreciated.

Bob

 

Re:form that is bigger than screen size?


Quote
> I have a form where I draw a (complex) picture on using Canvas->LineTo and
> so on.
> I need to draw the picture on size A0!
>...... [snipped]
> Since I redraw the picture, my idea is to redraw it at a window that is a
> big as my A0 page, hence having a bitmap at "real" size.

You would have to make the form the size of the printer (in pixels).
Then you must get the form to a bitmap of the size size. Many Windows
machines will simply not handle this size. GetFormImage() does not
work very well, and even if it did, it cannot capture an entire form image
that exceeds the screensize.

I would recommend taking a look at our
TExcellentFormPrinter product, available at:
http://www.code4sale.com/joehecht

Joe
--
Cycling to cure cancer: http://homepages.borland.com/jkaster/tnt/

Re:form that is bigger than screen size?


I believe you may make a form any size you want (pending resource
limitations). Make sure you set AutoScroll=true.

HTH
--
Mark L. Bartlett
http://www.sound.net/~mbartlet
** Please don't send NG 'stuff' to my email account. **

Re:form that is bigger than screen size?


Hi Mark,

Quote
> I believe you may make a form any size you want (pending resource
> limitations). Make sure you set AutoScroll=true.

In any case, it does not work when adjusting Width and Height in the Object
Inspector.
The maximum value one can enter is Width = 1036 and Height = 780.
Maybe it has to be done at runtime?

Bob

Re:form that is bigger than screen size?


Leslie,

I beg to differ. I have a 21 inch high-res NEC monitor. I just created a
form with height = 1036 and width 1292. However, with my monitor that
was the largest I could get at design time. I think design-time sizing
is dependant on monitor size/resolution.
--
Mark L. Bartlett
http://www.sound.net/~mbartlet
** Please don't send NG 'stuff' to my email account. **

Re:form that is bigger than screen size?


Quote
leslie bortels wrote:
> I have a form where I draw a (complex) picture on using Canvas->LineTo and
> so on.
> I need to draw the picture on size A0!
> Since I redraw the picture, my idea is to redraw it at a window that is a
> big as my A0 page, hence having a bitmap at "real" size.

Two ideas.  One is to put picture in a TScrollBox, that way you can have
the entire bitmap larger than the current form!  This will generally
look better for your users!

A better idea might be to use a metafile for the copy command.  This
will record all your vector drawing, since you are using LineTo-type
functions.  The metafile should be able to print in a better resolution
on the printer than you will have memory to handle with an on-screen
bitmap.

In practice, I very rarely directly export a bitmap of my form for
printing, but rather the sequence of commands to produce a better copy
of the image.  The difference is very noticable, even on low resolution
printers.

AlisdairM

Re:form that is bigger than screen size?


Hello,

Thanx for the tip but I still have some questions ...

Quote
> A better idea might be to use a metafile for the copy command.  This
> will record all your vector drawing, since you are using LineTo-type
> functions.  The metafile should be able to print in a better resolution
> on the printer than you will have memory to handle with an on-screen
> bitmap.

Can you please give me some help in how-to copy my form to a metafile?
In my program, I wrote two functions, copyFormToClipboard and
saveFormAsBitmap, both of them use moveFormToBitmap where the form is
translated into a bitmap.

So, if I'm correct, what I need to do is to make a function
moveFormToMetafile instead of
moveFormToBitmap.  I guess there is more to it than replacing TBitmap by
TMetafile in my code, isn't it.
Any help would greatly be apreciated ....

Bob

void TForm1::copyFormToClipboard(TForm* TheForm,int CropBottom)
{
 Graphics::TBitmap* Bitmap = new Graphics::TBitmap();
 moveFormToBitmap(TheForm,Bitmap,CropBottom);
 Clipboard()->Assign(Bitmap);
 delete(Bitmap);

Quote
}

void TForm1::saveFormAsBitmap(TForm* TheForm,int CropBottom)
{
 Graphics::TBitmap* Bitmap = new Graphics::TBitmap();
 moveFormToBitmap(TheForm,Bitmap,CropBottom);
 SaveBitmapDialog->Title = "Save Form as Bitmap ...";
 SaveBitmapDialog->InitialDir = Form1->inpuDir_;
 if (SaveBitmapDialog->Execute()) {
    Bitmap->SaveToFile(SaveBitmapDialog->FileName);
 }
 delete(Bitmap);

Quote
}

void TForm1::moveFormToBitmap(TForm *TheForm,Graphics::TBitmap* Bitmap,int
CropBottom)
{

    HDC HScreenDC = GetDC(TheForm->Handle);

    Bitmap->Handle = CreateCompatibleBitmap(HScreenDC,

TheForm->ClientWidth,(TheForm->ClientHeight-CropBottom));

    int result = GetDeviceCaps(HScreenDC, RASTERCAPS);
    if (result & RC_PALETTE)
    {
        int palette_size = GetDeviceCaps(HScreenDC,SIZEPALETTE);
        if (palette_size == 256)
        {
            int size = sizeof(LOGPALETTE) + 256 * sizeof(PALET{*word*249}TRY);
            LPLOGPALETTE lplogpal =
                (LPLOGPALETTE) new unsigned char[size];
            lplogpal->palVersion = 0x300;
            lplogpal->palNumEntries = 256;
            GetSystemPalet{*word*249}tries(HScreenDC,0,256,lplogpal->palPalEntry);
            Bitmap->Palette = CreatePalette(lplogpal);
            delete [] lplogpal;
        }
    }
    ReleaseDC(0, HScreenDC);

    HDC HFormDC = GetDC(TheForm->Handle);

BitBlt(Bitmap->Canvas->Handle,0,0,Bitmap->Width,Bitmap->Height,HFormDC,0,0,S
RCCOPY);
    ReleaseDC(TheForm->Handle,HFormDC);

Quote
}

"AlisdairM" <alisdair.meredith@NO_SPAM_PLEASE.benettonformula.com> wrote in
message news:3AA40CF9.5C54E080@NO_SPAM_PLEASE.benettonformula.com...
Quote
> leslie bortels wrote:

> > I have a form where I draw a (complex) picture on using Canvas->LineTo
and
> > so on.
> > I need to draw the picture on size A0!

> > Since I redraw the picture, my idea is to redraw it at a window that is
a
> > big as my A0 page, hence having a bitmap at "real" size.

> Two ideas.  One is to put picture in a TScrollBox, that way you can have
> the entire bitmap larger than the current form!  This will generally
> look better for your users!

> A better idea might be to use a metafile for the copy command.  This
> will record all your vector drawing, since you are using LineTo-type
> functions.  The metafile should be able to print in a better resolution
> on the printer than you will have memory to handle with an on-screen
> bitmap.

> In practice, I very rarely directly export a bitmap of my form for
> printing, but rather the sequence of commands to produce a better copy
> of the image.  The difference is very noticable, even on low resolution
> printers.

> AlisdairM

Other Threads