Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
Chris Jones  
#1 Posted : Tuesday, June 21, 2016 7:49:58 AM(UTC)
Chris Jones

Rank: Advanced Member

Groups: Member
Joined: 6/9/2016(UTC)
Posts: 34

Thanks: 22 times
Are there any settings that affect rendering performance of calling DrawImage()? Currently rendering paths are quick but drawing images are fairly slow (150-300 millisecond range depending on size).

I ask about settings due to seeing the link below about GDI+ DrawImage performance and was wondering whether there are equivalent or relevant settings that affect GraphicsMill. Even if it reduces the quality.

http://stackoverflow.com/questions/11020710/is-graphics-drawimage-too-slow-for-bigger-images

Other than settings, is there anything else i can do to improve performance of this? One thing i will try is to convert the image to match the same pixel format (RGB to cmyka). Should this help?

Thanks
Eugene Kosmin  
#2 Posted : Tuesday, June 21, 2016 5:42:51 PM(UTC)
Eugene Kosmin

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 9/19/2006(UTC)
Posts: 446

Was thanked: 24 time(s) in 24 post(s)
Hi Chris,

We will check the performance of DrawImage method by the next major release.

Unfortunately, there are no settings you could use for performance tuning.

If you draw a bitmap on a bitmap and there are no clipping paths and transforms, you can try to use Bitmap.Draw method. Both pixel formats must be the same.
Best regards,
Eugene Kosmin.
Aurigma Development Team
thanks 1 user thanked Eugene Kosmin for this useful post.
Chris Jones on 6/21/2016(UTC)
Chris Jones  
#3 Posted : Thursday, June 23, 2016 2:48:25 AM(UTC)
Chris Jones

Rank: Advanced Member

Groups: Member
Joined: 6/9/2016(UTC)
Posts: 34

Thanks: 22 times
Just an update:

Drawing a 5000x3333 pixel image cropped to a few hundred pixel area was taking 300-400 milliseconds and applying a scaling transform to stretch it to fit made it take 10x longer at 3350 milliseconds!

I've found a better approach which is to take a copy of the large bitmap, resize it using the low quality option to make it match the exact target bitmap size and just draw it on the target bitmap with no transform. It is now down to the 100-200 millisecond range.

There are probably a few more optimisations that i can make as well such as caching off the resized intermediate bitmap and possibly doing all rendering on a separate thread to keep the UI smooth.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.