[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Need a HIGH preform graphics

Posted on 1998-12-03
7
Medium Priority
?
194 Views
Last Modified: 2010-04-04
I want to show a TBitmap, that is being modified very often, to an user (20+ frames a second). If possible in a form (600x400). I need delphi 3 example with source.
0
Comment
Question by:God_Ares
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 4

Expert Comment

by:jack_p50
ID: 1349102
See here in VCL section in graphics part - here are many such things as you need :
http://bes.trendline.co.il/torry/
0
 
LVL 3

Expert Comment

by:williams2
ID: 1349103
Hmmm.. Hey Jack! I don't see any source ?

God_Ares: here's a way to deal with it:

You need to drop a TOpenPictureDialog to your form and then add a Form OnCreate event procedure, the n the rest is cut'n'paste:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtDlgs, ExtCtrls;

type
  TForm1 = class(TForm)
    OpenPictureDialog1: TOpenPictureDialog;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    a,b: TBitmap;
    Timer: TTimer;
    Next: Integer;
    Function GetNewImage: TBitmap;
    procedure OnTime(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

Function TForm1.GetNewImage: TBitmap;
begin
  Result:= TBitmap.Create;
  If OpenPictureDialog1.Execute then
    Result.LoadFromFile(OpenPictureDialog1.Filename);
End;

procedure TForm1.FormCreate(Sender: TObject);
begin
  ClientWidth:= 640;
  ClientHeight:= 480;
  a:= GetNewImage;
  b:= GetNewImage;
  Next:= 0;
  Timer:= TTimer.Create(Self);
  Timer.Interval:= 1000;
  Timer.OnTimer:= OnTime;
  Timer.Enabled:= True;
end;

procedure TForm1.OnTime(Sender: TObject);
var
  TempHandle: hWnd;
  dwRop: DWord;
begin
  next:= 1-Next;
  dwRop:= SRCCOPY;
  If next=0 then TempHandle:= a.Canvas.Handle else TempHandle:= b.Canvas.Handle;
  BitBlt(
    Canvas.Handle,      // handle to destination device context
    0,                  // x-coordinate of destination rectangle's upper-left corner
    0,                  // y-coordinate of destination rectangle's upper-left corner
    640,            // width of destination rectangle
    480,            // height of destination rectangle
    TempHandle,            // handle to source device context
    0,                  // x-coordinate of source rectangle's upper-left corner
    0,                  // y-coordinate of source rectangle's upper-left corner
    dwRop             // raster operation code (See below)
   );
{
BLACKNESS      Fills the destination rectangle using the color associated with
            index 0 in the physical palette. (This color is black for the
                default physical palette.)
DSTINVERT      Inverts the destination rectangle.
MERGECOPY      Merges the colors of the source rectangle with the specified
            pattern by using the Boolean AND operator.
MERGEPAINT      Merges the colors of the inverted source rectangle with the
            colors of the destination rectangle by using the Boolean OR
                operator.
NOTSRCCOPY      Copies the inverted source rectangle to the destination.
NOTSRCERASE      Combines the colors of the source and destination rectangles
            by using the Boolean OR operator and then inverts the resultant
                color.
PATCOPY            Copies the specified pattern into the destination bitmap.
PATINVERT      Combines the colors of the specified pattern with the colors of
            the destination rectangle by using the Boolean XOR operator.
PATPAINT      Combines the colors of the pattern with the colors of the
            inverted source rectangle by using the Boolean OR operator. The
                result of this operation is combined with the colors of the
                destination rectangle by using the Boolean OR operator.
SRCAND            Combines the colors of the source and destination rectangles
            by using the Boolean AND operator.
SRCCOPY            Copies the source rectangle directly to the destination
            rectangle.
SRCERASE      Combines the inverted colors of the destination rectangle with
            the colors of the source rectangle by using the Boolean AND operator.
SRCINVERT      Combines the colors of the source and destination rectangles
            by using the Boolean XOR operator.
SRCPAINT      Combines the colors of the source and destination rectangles by
            using the Boolean OR operator.
WHITENESS      Fills the destination rectangle using the color associated with
            index 1 in the physical palette. (This color is white for the
                default physical palette.)
}
End;
end.

0
 
LVL 3

Expert Comment

by:williams2
ID: 1349104
..You should maybe said the timer to 50, and you will see.

Cheers,
Williams
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 7

Author Comment

by:God_Ares
ID: 1349105
Sorry jack_p50,

I agree with williams2. It isn't exactly as i wanted to be...

But Williams2 answer was perfect. So i must be honest and give points to williams2.

Please williams2 answer this question (with a dummy answer)
and recieve those points!.

Thanx to all...
Greetz God_Ares.
0
 
LVL 5

Expert Comment

by:ronit051397
ID: 1349106
See Graphics examples on   http://www.efg2.com/lab/
0
 

Expert Comment

by:Aleq
ID: 1349107
Try direct-x components.
0
 
LVL 3

Accepted Solution

by:
williams2 earned 400 total points
ID: 1349108
Thanks Aleq!

Jack: I do not hope you to have any hard feelings aboiut this mr, you should maybe try making an example next time. I guess you knew how to deal with it.

Cheers
Williams
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question