Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Image DnD into Upp app
Re: Image DnD into Upp app [message #44202 is a reply to message #44199] Fri, 23 January 2015 09:43 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
bushman wrote on Thu, 22 January 2015 21:18
Hello, Mirek,

Splendid! Almost there...

...works great in Win7 now, but still does not drop jpg from MS Word into UWord in Win8.1. Test output creates a blank data.bin and this fmt LOG:
* C:\upp\out\examples\MSC9.Debug.Debug_Full.Gui.Mt\UWord.exe 22.01.2015 17:05:00, user: admin
fmt = dib

DnD jpg from File Explorer into UWord works perfectly in both OS versions.

Any hint on what to try next?

Many thanks!!!




Well, looks like problem with dib... Some more logs:

Image GetImage(PasteClip& clip)
{
	GuiLock __;
	Image m;
	if(Accept<Image>(clip)) {
		LoadFromString(m, ~clip);
		if(!m.IsEmpty())
			return m;
	}
	if(clip.Accept("dib")) {
LOG("DIB accepted");
		String data = ~clip;
		if((unsigned)data.GetCount() < sizeof(BITMAPINFO)) return Null;
LOG("DIB accepted 2");
		BITMAPINFO *lpBI = 	(BITMAPINFO *)~data;
		BITMAPINFOHEADER& hdr = lpBI->bmiHeader;
		byte *bits = (byte *)lpBI + hdr.biSize;
		if(hdr.biBitCount <= 8)
			bits += (hdr.biClrUsed ? hdr.biClrUsed : 1 << hdr.biBitCount) * sizeof(RGBQUAD);
		if(hdr.biBitCount >= 16 || hdr.biBitCount == 32) {
			if(hdr.biCompression == 3)
				bits += 12;
			if(hdr.biClrUsed != 0)
				bits += hdr.biClrUsed * sizeof(RGBQUAD);
		}
DUMP(bits);
DUMP((int)hdr.biHeight);
DUMP((int)hdr.biWidth);
		int h = abs((int)hdr.biHeight);
		ImageDraw   iw(hdr.biWidth, h);
		::StretchDIBits(iw.GetHandle(),
			0, 0, hdr.biWidth, h,
			0, 0, hdr.biWidth, h,
			bits, lpBI, DIB_RGB_COLORS, SRCCOPY);
		return iw;
	}
	return Null;
}


Thanks!

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Context Menu request
Next Topic: rounding to decimals implementation
Goto Forum:
  


Current Time: Thu May 16 10:20:53 CEST 2024

Total time taken to generate the page: 0.01633 seconds