Advertisement

05.06.2008 at 03:16AM PDT, ID: 23378936
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Graphic.SaveToStream - Takes morethan 600ms in Delphi

Tags: Delphi, Ver 6
Hi Experts,
I'm facing a strange problem in OCX written in Delphi 6.
What I'm trying to do is to send a Jpeg image to the host as array of Variant.

When I time the following code, Graphic.SaveToStream(strmMem) takes about 600 ms. Is there anything wrong in the way I'm code?

function TPCSTrioPRMV2.GraphicToVar(Graphic: TGraphic): Variant;
var
 strmMem : TMemoryStream;
 lpMem   : Pointer;
begin
  strmMem := TMemoryStream.Create; // Create stream for persisting graphic
  try // Resource protection
    Graphic.SaveToStream(strmMem); // Save graphic to stream
    TVariantArg(result).vt:=VT_UI1 or VT_ARRAY; // Set result vt type
    TVariantArg(result).parray := SafeArrayCreateVector(VT_UI1, 0, strmMem.Size); // Create safearray for result
    lpMem:= VarArrayLock(result); // Lock the array
    try      // Resource protection
       Move(strmMem.Memory^, lpMem^, strmMem.Size); // Move memory from the stream to the array
    finally
       VarArrayUnlock(result); // Unlock the array
    end;
  finally
    strmMem.Free; // Free the stream
  end;
end;
Start your free trial to view this solution
Question Stats
Zone: Programming
Question Asked By: pcssecure
Solution Provided By: ziolko
Participating Experts: 1
Solution Grade: A
Views: 0
Translate:
Loading Advertisement...
05.06.2008 at 04:15AM PDT, ID: 21506235

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.06.2008 at 04:27AM PDT, ID: 21506294

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.06.2008 at 07:24PM PDT, ID: 21512747

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.06.2008 at 08:11PM PDT, ID: 21512922

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.06.2008 at 09:56PM PDT, ID: 21513266

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.07.2008 at 12:08AM PDT, ID: 21513737

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.09.2008 at 02:42PM PDT, ID: 21536566

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 03:21AM PDT, ID: 21545662

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 07:37AM PDT, ID: 21547355

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 07:50AM PDT, ID: 21547468

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 07:58AM PDT, ID: 21547522

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 08:11AM PDT, ID: 21547649

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 08:18AM PDT, ID: 21547721

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
05.12.2008 at 10:01PM PDT, ID: 21552438

Rank: Sage

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080236-EE-VQP-29 / EE_QW_2_20070628