U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » GIF reader BUG? Or BUG in inserting GIF into QTF?
Re: GIF reader BUG? Or BUG in inserting GIF into QTF? [message #5716 is a reply to message #5675] Wed, 11 October 2006 07:41 Go to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
The problem (my fault) is that the size of image is created from "physical" size recorded in .gif, which is too small. When the image is converted to PNG, this info is lost (do not ask me why...) and the physical size is computed from "pixel" size (using 96DPI formula).

The necessary fix (which is useful anyway) is to introduce width/height parameters to CreateImageObject:

RichObject CreateImageObject(const Image& img, int cx, int cy)
{
	RichObject o = RichObject("image", StoreImageAsString(img));
	if(cx || cy)
		o.SetSize(GetRatioSize(o.GetPixelSize(), cx, cy));
	return o;
}


Note that you can leave cx or cy zero - image is then sized keeping the aspect ratio. If both are zero, "physical" size is used (as with recent version).

This code is now part of U++ and will be in the next release.

Mirek
 
Read Message BugQuestion.gif
Read Message
Previous Topic: GetFontInfo without a Draw object?
Next Topic: Graphics Context and Draw Object
Goto Forum:
  


Current Time: Thu Sep 17 22:44:39 GMT+2 2026

Total time taken to generate the page: 0.00704 seconds